Skip to content

Commit

Permalink
Merge adjacent integer key tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 11, 2023
1 parent 9604317 commit d816a2e
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1896,17 +1896,16 @@ fn test_integer_key() {
test_encode_ok(&[(&map, j)]);
test_parse_ok(vec![(j, map)]);

let j = r#"{"x":null}"#;
test_parse_err::<BTreeMap<i32, ()>>(&[(
j,
"invalid value: expected key to be a number in quotes at line 1 column 2",
)]);

let j = r#"{" 123":null}"#;
test_parse_err::<BTreeMap<i32, ()>>(&[(
j,
"invalid value: expected key to be a number in quotes at line 1 column 2",
)]);
test_parse_err::<BTreeMap<i32, ()>>(&[
(
r#"{"x":null}"#,
"invalid value: expected key to be a number in quotes at line 1 column 2",
),
(
r#"{" 123":null}"#,
"invalid value: expected key to be a number in quotes at line 1 column 2",
),
]);
}

#[test]
Expand Down

0 comments on commit d816a2e

Please sign in to comment.