diff options
Diffstat (limited to 'libgo/go/exp/datafmt/datafmt_test.go')
-rw-r--r-- | libgo/go/exp/datafmt/datafmt_test.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libgo/go/exp/datafmt/datafmt_test.go b/libgo/go/exp/datafmt/datafmt_test.go index 66794cfde5d..d7c70b21dec 100644 --- a/libgo/go/exp/datafmt/datafmt_test.go +++ b/libgo/go/exp/datafmt/datafmt_test.go @@ -7,11 +7,15 @@ package datafmt import ( "fmt" "testing" + "go/token" ) +var fset = token.NewFileSet() + + func parse(t *testing.T, form string, fmap FormatterMap) Format { - f, err := Parse("", []byte(form), fmap) + f, err := Parse(fset, "", []byte(form), fmap) if err != nil { t.Errorf("Parse(%s): %v", form, err) return nil @@ -76,10 +80,10 @@ func TestCustomFormatters(t *testing.T) { f = parse(t, ``, fmap1) verify(t, f, `even odd even odd `, 0, 1, 2, 3) - f = parse(t, `/ =@:blank; float="#"`, fmap1) + f = parse(t, `/ =@:blank; float64="#"`, fmap1) verify(t, f, `# # #`, 0.0, 1.0, 2.0) - f = parse(t, `float=@:nil`, fmap1) + f = parse(t, `float64=@:nil`, fmap1) verify(t, f, ``, 0.0, 1.0, 2.0) f = parse(t, `testing "testing"; ptr=*`, fmap2) @@ -135,7 +139,7 @@ func TestBasicTypes(t *testing.T) { const f = 3.141592 const fs = `3.141592` - check(t, `float ="%g"`, fs, f) + check(t, `float64="%g"`, fs, f) check(t, `float32="%g"`, fs, float32(f)) check(t, `float64="%g"`, fs, float64(f)) } |