Skip to content

Commit

Permalink
Merge pull request #43 from waywardmonkeys/needless-raw-string-hashes
Browse files Browse the repository at this point in the history
clippy: Fix unnecessary hashes around raw string literal.
  • Loading branch information
eminence authored Aug 25, 2024
2 parents 7a2710a + afebd2d commit b253c69
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tests/suite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ fn test_mut() {
fn test_mal_01() {
// some tests for error handling

let data = r##"
let data = r#"
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<names>
<name first="bob" last="jones />
<name first="elizabeth" last="smith" />
</names>
"##;
"#;

let names_element = Element::parse(data.as_bytes());
if let Err(ParseError::MalformedXml(..)) = names_element {
Expand Down Expand Up @@ -127,13 +127,13 @@ fn test_mal_02() {
fn test_mal_03() {
// some tests for error handling

let data = r##"
let data = r#"
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<names>
<name first="bob" last="jones"></badtag>
<name first="elizabeth" last="smith" />
</names>
"##;
"#;

let names_element = Element::parse(data.as_bytes());
if let Err(ParseError::MalformedXml(..)) = names_element {
Expand All @@ -155,7 +155,7 @@ fn test_new() {

#[test]
fn test_take() {
let data_xml_1 = r##"
let data_xml_1 = r#"
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<names>
<name first="bob" last="jones"></name>
Expand All @@ -164,15 +164,15 @@ fn test_take() {
<child />
</remove_me>
</names>
"##;
"#;

let data_xml_2 = r##"
let data_xml_2 = r#"
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<names>
<name first="bob" last="jones"></name>
<name first="elizabeth" last="smith" />
</names>
"##;
"#;

let mut data_1 = Element::parse(data_xml_1.trim().as_bytes()).unwrap();
let data_2 = Element::parse(data_xml_2.trim().as_bytes()).unwrap();
Expand Down Expand Up @@ -242,37 +242,37 @@ fn test_ns() {

#[test]
fn test_text() {
let data = r##"
let data = r#"
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<elem><inner/></elem>
"##;
"#;

let elem = Element::parse(data.trim().as_bytes()).unwrap();
assert!(elem.get_text().is_none());

let data = r##"
let data = r#"
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<elem>hello world<inner/></elem>
"##;
"#;

let elem = Element::parse(data.trim().as_bytes()).unwrap();
assert_eq!(elem.get_text().unwrap(), Cow::Borrowed("hello world"));

let data = r##"
let data = r#"
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<elem>hello <inner/>world</elem>
"##;
"#;

let elem = Element::parse(data.trim().as_bytes()).unwrap();
assert_eq!(
elem.get_text().unwrap(),
Cow::from("hello world".to_owned())
);

let data = r##"
let data = r#"
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<elem>hello <inner/><![CDATA[<world>]]></elem>
"##;
"#;

let elem = Element::parse(data.trim().as_bytes()).unwrap();
assert_eq!(
Expand Down

0 comments on commit b253c69

Please sign in to comment.