diff --git a/serde_with/tests/hashbrown_0_14.rs b/serde_with/tests/hashbrown_0_14.rs index 9e522e79..57c06eae 100644 --- a/serde_with/tests/hashbrown_0_14.rs +++ b/serde_with/tests/hashbrown_0_14.rs @@ -322,6 +322,10 @@ fn test_map_skip_error_hashmap() { } }"#, ); + check_error_deserialization::( + r#"{"tag":"type", "values":{"0": 1,}}"#, + expect!["trailing comma at line 1 column 33"], + ); is_equal( S { tag: "round-trip".into(), diff --git a/serde_with/tests/indexmap_1.rs b/serde_with/tests/indexmap_1.rs index 49f50fe1..10d92dbc 100644 --- a/serde_with/tests/indexmap_1.rs +++ b/serde_with/tests/indexmap_1.rs @@ -282,6 +282,10 @@ fn test_map_skip_error_indexmap() { } }"#, ); + check_error_deserialization::( + r#"{"tag":"type", "values":{"0": 1,}}"#, + expect!["trailing comma at line 1 column 33"], + ); is_equal( S { tag: "round-trip".into(), diff --git a/serde_with/tests/indexmap_2.rs b/serde_with/tests/indexmap_2.rs index 91de9b3b..0128825c 100644 --- a/serde_with/tests/indexmap_2.rs +++ b/serde_with/tests/indexmap_2.rs @@ -282,6 +282,10 @@ fn test_map_skip_error_indexmap() { } }"#, ); + check_error_deserialization::( + r#"{"tag":"type", "values":{"0": 1,}}"#, + expect!["trailing comma at line 1 column 33"], + ); is_equal( S { tag: "round-trip".into(), diff --git a/serde_with/tests/serde_as/lib.rs b/serde_with/tests/serde_as/lib.rs index 2f525775..74cf32b4 100644 --- a/serde_with/tests/serde_as/lib.rs +++ b/serde_with/tests/serde_as/lib.rs @@ -572,6 +572,10 @@ fn test_vec_skip_error() { }, r#"{"tag":"type","values":[0, "str", 1, [10, 11], -2, {}, 300]}"#, ); + check_error_deserialization::( + r#"{"tag":"type", "values":[0, "str", 1, , 300]}"#, + expect!["expected value at line 1 column 39"], + ); is_equal( S { tag: "round-trip".into(), @@ -618,6 +622,10 @@ fn test_map_skip_error_btreemap() { } }"#, ); + check_error_deserialization::( + r#"{"tag":"type", "values":{"0": 1,}}"#, + expect!["trailing comma at line 1 column 33"], + ); is_equal( S { tag: "round-trip".into(), @@ -706,6 +714,10 @@ fn test_map_skip_error_hashmap() { } }"#, ); + check_error_deserialization::( + r#"{"tag":"type", "values":{"0": 1,}}"#, + expect!["trailing comma at line 1 column 33"], + ); is_equal( S { tag: "round-trip".into(),