github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/talks/2013/bestpractices/funcdraw/drawer/drawer_test.go (about) 1 // +build ignore,OMIT 2 3 package drawer 4 5 import ( 6 "math" 7 "testing" 8 ) 9 10 type TestFunc func(float64) float64 11 12 func (f TestFunc) Eval(x float64) float64 { return f(x) } 13 14 var ( 15 ident = TestFunc(func(x float64) float64 { return x }) 16 sin = TestFunc(math.Sin) 17 ) 18 19 func TestDraw_Ident(t *testing.T) { 20 m := Draw(ident) 21 // Verify obtained image. 22 // END OMIT 23 t.Error(m.ColorModel()) 24 }