@@ -927,15 +927,6 @@ var unmarshalTests = []struct {
927927 "true #" + strings .Repeat (" " , 512 * 3 ),
928928 "true" ,
929929 },
930- // C1 Control characters
931- {
932- "\u0080 " ,
933- "\u0080 " ,
934- },
935- {
936- "\u009F " ,
937- "\u009F " ,
938- },
939930
940931 // CRLF
941932 {
@@ -1134,13 +1125,13 @@ var unmarshalErrorTests = []struct {
11341125 {"v: [A," , "yaml: line 1: did not find expected node content" },
11351126 {"v:\n - [A," , "yaml: line 2: did not find expected node content" },
11361127 {"a:\n - b: *," , "yaml: line 2: did not find expected alphabetic or numeric character" },
1137- {"a: *b\n " , "yaml: line 1: unknown anchor 'b' referenced" },
1128+ {"a: *b\n " , "yaml: unknown anchor 'b' referenced" },
11381129 {"a: &a\n b: *a\n " , "yaml: anchor 'a' value contains itself" },
11391130 {"value: -" , "yaml: block sequence entries are not allowed in this context" },
11401131 {"a: !!binary ==" , "yaml: !!binary value contains invalid base64 data" },
11411132 {"{[.]}" , `yaml: cannot use '\[\]interface \{\}\{"\."\}' as a map key; try decoding into yaml.Node` },
11421133 {"{{.}}" , `yaml: cannot use 'map\[string]interface \{\}\{".":interface \{\}\(nil\)\}' as a map key; try decoding into yaml.Node` },
1143- {"b: *a\n a: &a {c: 1}" , `yaml: line 1: unknown anchor 'a' referenced` },
1134+ {"b: *a\n a: &a {c: 1}" , `yaml: unknown anchor 'a' referenced` },
11441135 {"%TAG !%79! tag:yaml.org,2002:\n ---\n v: !%79!int '1'" , "yaml: did not find expected whitespace" },
11451136 {"a:\n 1:\n b\n 2:" , ".*could not find expected ':'" },
11461137 {"a: 1\n b: 2\n c 2\n d: 3\n " , "^yaml: line 3: could not find expected ':'$" },
@@ -2132,31 +2123,6 @@ a:
21322123 }
21332124}
21342125
2135- func TestParserErrorUnknownAnchorPosition (t * testing.T ) {
2136- tests := []struct {
2137- data string
2138- line int
2139- column int
2140- }{
2141- {"*x" , 1 , 1 },
2142- {"a: *x" , 1 , 4 },
2143- {"a:\n b: *x" , 2 , 6 },
2144- }
2145-
2146- for _ , test := range tests {
2147- var n yaml.Node
2148- err := yaml .Unmarshal ([]byte (test .data ), & n )
2149- asErr := new (yaml.ParserError )
2150- assert .ErrorAs (t , err , & asErr )
2151- expected := & yaml.ParserError {
2152- Message : "unknown anchor 'x' referenced" ,
2153- Line : test .line ,
2154- Column : test .column ,
2155- }
2156- assert .DeepEqual (t , expected , asErr )
2157- }
2158- }
2159-
21602126//var data []byte
21612127//func init() {
21622128// var err error
0 commit comments