Skip to content

Commit 0abf922

Browse files
committed
Fix formatting of \0 in tests by changing it to \u{1}
This follows this PR in rustc: <rust-lang/rust#95345> Which breakage was discussed here: <rust-lang/rust#95732> Still relying on \0 would require bumping the MSRV to 1.61.0
1 parent 2efbe5c commit 0abf922

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

tests/integration/cdata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ test!(cdata_09, "<p><![CDATA[bracket ]after]]></p>",
6868
Token::ElementEnd(ElementEnd::Close("", "p"), 29..33)
6969
);
7070

71-
test!(cdata_err_01, "<p><![CDATA[\0]]></p>",
71+
test!(cdata_err_01, "<p><![CDATA[\u{1}]]></p>",
7272
Token::ElementStart("", "p", 0..2),
7373
Token::ElementEnd(ElementEnd::Open, 2..3),
74-
Token::Error("invalid CDATA at 1:4 cause a non-XML character '\\u{0}' found at 1:13".to_string())
74+
Token::Error("invalid CDATA at 1:4 cause a non-XML character '\\u{1}' found at 1:13".to_string())
7575
);

tests/integration/elements.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ test!(attribute_err_05, "<c a='<'/>",
209209
Token::Error("invalid attribute at 1:3 cause expected ''' not '<' at 1:7".to_string())
210210
);
211211

212-
test!(attribute_err_06, "<c a='\0'/>",
212+
test!(attribute_err_06, "<c a='\u{1}'/>",
213213
Token::ElementStart("", "c", 0..2),
214-
Token::Error("invalid attribute at 1:3 cause a non-XML character '\\u{0}' found at 1:7".to_string())
214+
Token::Error("invalid attribute at 1:3 cause a non-XML character '\\u{1}' found at 1:7".to_string())
215215
);
216216

217217
test!(attribute_err_07, "<c a='v'b='v'/>",

tests/integration/pi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ test!(declaration_err_12, "<?xml version='1.0'?><?xml version='1.0'?>",
118118
Token::Error("unknown token at 1:22".to_string())
119119
);
120120

121-
test!(declaration_err_13, "<?target \u{0000}content>",
122-
Token::Error("invalid processing instruction at 1:1 cause a non-XML character '\\u{0}' found at 1:10".to_string())
121+
test!(declaration_err_13, "<?target \u{1}content>",
122+
Token::Error("invalid processing instruction at 1:1 cause a non-XML character '\\u{1}' found at 1:10".to_string())
123123
);
124124

125125
test!(declaration_err_14, "<?xml version='1.0'encoding='UTF-8'?>",

0 commit comments

Comments
 (0)