summaryrefslogtreecommitdiff
path: root/src/pkg/json/scanner_test.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-01-17 12:40:45 +0100
committerOndřej Surý <ondrej@sury.org>2011-01-17 12:40:45 +0100
commit3e45412327a2654a77944249962b3652e6142299 (patch)
treebc3bf69452afa055423cbe0c5cfa8ca357df6ccf /src/pkg/json/scanner_test.go
parentc533680039762cacbc37db8dc7eed074c3e497be (diff)
downloadgolang-upstream/2011.01.12.tar.gz
Imported Upstream version 2011.01.12upstream/2011.01.12
Diffstat (limited to 'src/pkg/json/scanner_test.go')
-rw-r--r--src/pkg/json/scanner_test.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pkg/json/scanner_test.go b/src/pkg/json/scanner_test.go
index cdc032263..2dc8ff87f 100644
--- a/src/pkg/json/scanner_test.go
+++ b/src/pkg/json/scanner_test.go
@@ -19,14 +19,14 @@ type example struct {
}
var examples = []example{
- example{`1`, `1`},
- example{`{}`, `{}`},
- example{`[]`, `[]`},
- example{`{"":2}`, "{\n\t\"\": 2\n}"},
- example{`[3]`, "[\n\t3\n]"},
- example{`[1,2,3]`, "[\n\t1,\n\t2,\n\t3\n]"},
- example{`{"x":1}`, "{\n\t\"x\": 1\n}"},
- example{ex1, ex1i},
+ {`1`, `1`},
+ {`{}`, `{}`},
+ {`[]`, `[]`},
+ {`{"":2}`, "{\n\t\"\": 2\n}"},
+ {`[3]`, "[\n\t3\n]"},
+ {`[1,2,3]`, "[\n\t1,\n\t2,\n\t3\n]"},
+ {`{"x":1}`, "{\n\t\"x\": 1\n}"},
+ {ex1, ex1i},
}
var ex1 = `[true,false,null,"x",1,1.5,0,-5e+2]`
@@ -138,7 +138,7 @@ func TestNextValueBig(t *testing.T) {
var scan scanner
item, rest, err := nextValue(jsonBig, &scan)
if err != nil {
- t.Fatalf("nextValue: ", err)
+ t.Fatalf("nextValue: %s", err)
}
if len(item) != len(jsonBig) || &item[0] != &jsonBig[0] {
t.Errorf("invalid item: %d %d", len(item), len(jsonBig))
@@ -147,9 +147,9 @@ func TestNextValueBig(t *testing.T) {
t.Errorf("invalid rest: %d", len(rest))
}
- item, rest, err = nextValue(bytes.Add(jsonBig, []byte("HELLO WORLD")), &scan)
+ item, rest, err = nextValue(append(jsonBig, []byte("HELLO WORLD")...), &scan)
if err != nil {
- t.Fatalf("nextValue extra: ", err)
+ t.Fatalf("nextValue extra: %s", err)
}
if len(item) != len(jsonBig) {
t.Errorf("invalid item: %d %d", len(item), len(jsonBig))