Skip to content

Commit

Permalink
Fix formatting of \0 in tests by changing it to \u{1}
Browse files Browse the repository at this point in the history
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
  • Loading branch information
krtab committed Oct 12, 2022
1 parent 2efbe5c commit c542871
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/integration/cdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ test!(cdata_09, "<p><![CDATA[bracket ]after]]></p>",
Token::ElementEnd(ElementEnd::Close("", "p"), 29..33)
);

test!(cdata_err_01, "<p><![CDATA[\0]]></p>",
test!(cdata_err_01, "<p><![CDATA[\u{1}]]></p>",
Token::ElementStart("", "p", 0..2),
Token::ElementEnd(ElementEnd::Open, 2..3),
Token::Error("invalid CDATA at 1:4 cause a non-XML character '\\u{0}' found at 1:13".to_string())
Token::Error("invalid CDATA at 1:4 cause a non-XML character '\\u{1}' found at 1:13".to_string())
);
2 changes: 1 addition & 1 deletion tests/integration/elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ test!(attribute_err_05, "<c a='<'/>",

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

test!(attribute_err_07, "<c a='v'b='v'/>",
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/pi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ test!(declaration_err_12, "<?xml version='1.0'?><?xml version='1.0'?>",
Token::Error("unknown token at 1:22".to_string())
);

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

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

0 comments on commit c542871

Please sign in to comment.