From: Robert Griesemer Date: Fri, 7 Sep 2012 23:28:15 +0000 (-0700) Subject: go/scanner: add missing BOM test X-Git-Tag: go1.1rc2~2504 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2a391f467d25354477013cc28f2d41f8dae39604;p=gostls13.git go/scanner: add missing BOM test R=r CC=golang-dev https://golang.org/cl/6498106 --- diff --git a/src/pkg/go/scanner/scanner_test.go b/src/pkg/go/scanner/scanner_test.go index 119679a31f..1c19053e64 100644 --- a/src/pkg/go/scanner/scanner_test.go +++ b/src/pkg/go/scanner/scanner_test.go @@ -346,6 +346,7 @@ var lines = []string{ // # indicates a semicolon present in the source // $ indicates an automatically inserted semicolon "", + "\ufeff#;", // first BOM is ignored "#;", "foo$\n", "123$\n", @@ -694,6 +695,7 @@ var errors = []struct { {"0X", token.INT, 0, "illegal hexadecimal number"}, {"\"abc\x00def\"", token.STRING, 4, "illegal character NUL"}, {"\"abc\x80def\"", token.STRING, 4, "illegal UTF-8 encoding"}, + {"\ufeff\ufeff", token.ILLEGAL, 3, "illegal character U+FEFF"}, // only first BOM is ignored } func TestScanErrors(t *testing.T) {