Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
Fix fmt.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmorpheme committed Sep 15, 2021
1 parent 5690ac9 commit 076b3d5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/test_round_trip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ fn test_colon_in_string() {
#[test]
fn test_numberlike_strings() {
let docs = [
r#"x: "1234""#, r#"x: "01234""#, r#""1234""#,
r#""01234""#, r#"" 01234""#, r#""0x1234""#,
r#"x: "1234""#,
r#"x: "01234""#,
r#""1234""#,
r#""01234""#,
r#"" 01234""#,
r#""0x1234""#,
r#"" 0x1234""#,
];

Expand All @@ -53,13 +57,14 @@ fn test_numberlike_strings() {
/// Example from https://github.com/chyh1990/yaml-rust/issues/133
#[test]
fn test_issue133() {

let doc = YamlLoader::load_from_str("\"0x123\"").unwrap().pop().unwrap();
let doc = YamlLoader::load_from_str("\"0x123\"")
.unwrap()
.pop()
.unwrap();
assert_eq!(doc, Yaml::String("0x123".to_string()));

let mut out_str = String::new();
YamlEmitter::new(&mut out_str).dump(&doc).unwrap();
let doc2 = YamlLoader::load_from_str(&out_str).unwrap().pop().unwrap();
assert_eq!(doc, doc2); // This failed because the type has changed to a number now

}

0 comments on commit 076b3d5

Please sign in to comment.