From e1f20378a2a8c78f182b2ac61f76eebd30990b77 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 2 Oct 2023 18:51:08 -0500 Subject: [PATCH] test: Verify with latest data --- Cargo.lock | 4 ++-- crates/toml/Cargo.toml | 2 +- crates/toml/tests/decoder_compliance.rs | 7 ++----- crates/toml/tests/encoder_compliance.rs | 1 + crates/toml_edit/Cargo.toml | 2 +- crates/toml_edit/tests/decoder_compliance.rs | 9 +++------ .../tests/fixtures/invalid/encoding/bad-codepoint.stderr | 1 + .../tests/fixtures/invalid/float/exp-trailing-us.stderr | 7 ++++--- .../tests/fixtures/invalid/float/inf-capital.stderr | 6 ++++++ .../tests/fixtures/invalid/float/nan-capital.stderr | 6 ++++++ .../fixtures/invalid/float/trailing-us-exp-1.stderr | 6 ++++++ .../fixtures/invalid/float/trailing-us-exp-2.stderr | 6 ++++++ .../tests/fixtures/invalid/float/trailing-us-exp.stderr | 6 ------ .../fixtures/invalid/inline-table/bad-key-syntax.stderr | 6 ++++++ .../invalid/inline-table/dotted-key-conflict.stderr | 5 +++++ .../invalid/inline-table/nested_key_conflict.stderr | 0 .../table/append-to-array-with-dotted-keys.stderr | 5 +++++ .../invalid/table/duplicate-key-dotted-array.stderr | 6 ++++++ 18 files changed, 61 insertions(+), 24 deletions(-) create mode 100644 crates/toml_edit/tests/fixtures/invalid/encoding/bad-codepoint.stderr create mode 100644 crates/toml_edit/tests/fixtures/invalid/float/inf-capital.stderr create mode 100644 crates/toml_edit/tests/fixtures/invalid/float/nan-capital.stderr create mode 100644 crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp-1.stderr create mode 100644 crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp-2.stderr delete mode 100644 crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp.stderr create mode 100644 crates/toml_edit/tests/fixtures/invalid/inline-table/bad-key-syntax.stderr create mode 100644 crates/toml_edit/tests/fixtures/invalid/inline-table/dotted-key-conflict.stderr create mode 100644 crates/toml_edit/tests/fixtures/invalid/inline-table/nested_key_conflict.stderr create mode 100644 crates/toml_edit/tests/fixtures/invalid/table/append-to-array-with-dotted-keys.stderr create mode 100644 crates/toml_edit/tests/fixtures/invalid/table/duplicate-key-dotted-array.stderr diff --git a/Cargo.lock b/Cargo.lock index 05a57737..f82556f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -921,9 +921,9 @@ dependencies = [ [[package]] name = "toml-test-harness" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab6273ee89f4204793309f471313bc53d5881c38f02dc33303904e77107d04e" +checksum = "7346ccc45965d33ad1a15e558bc67f8c7a35a72d882f646c342fea9227390296" dependencies = [ "ignore", "libtest-mimic", diff --git a/crates/toml/Cargo.toml b/crates/toml/Cargo.toml index e24e75e2..1568e4ee 100644 --- a/crates/toml/Cargo.toml +++ b/crates/toml/Cargo.toml @@ -49,7 +49,7 @@ serde_spanned = { version = "0.6.3", path = "../serde_spanned", features = ["ser [dev-dependencies] serde = { version = "1.0.160", features = ["derive"] } serde_json = "1.0.96" -toml-test-harness = "0.4.4" +toml-test-harness = "0.4.5" toml-test-data = "1.3.1" snapbox = "0.4.11" diff --git a/crates/toml/tests/decoder_compliance.rs b/crates/toml/tests/decoder_compliance.rs index 5d4fc2a4..280fe075 100644 --- a/crates/toml/tests/decoder_compliance.rs +++ b/crates/toml/tests/decoder_compliance.rs @@ -7,13 +7,10 @@ fn main() { harness .ignore([ "valid/spec/float-0.toml", - // Unreleased - "valid/string/escape-esc.toml", - "valid/string/hex-escape.toml", - "valid/datetime/no-seconds.toml", - "valid/inline-table/newline.toml", + "invalid/inline-table/nested_key_conflict.toml", ]) .unwrap(); + harness.version("1.0.0"); harness.test(); } diff --git a/crates/toml/tests/encoder_compliance.rs b/crates/toml/tests/encoder_compliance.rs index 38072483..8702b3af 100644 --- a/crates/toml/tests/encoder_compliance.rs +++ b/crates/toml/tests/encoder_compliance.rs @@ -7,6 +7,7 @@ fn main() { let decoder = decoder::Decoder; let mut harness = toml_test_harness::EncoderHarness::new(encoder, decoder); harness.ignore(["valid/spec/float-0.toml"]).unwrap(); + harness.version("1.0.0"); harness.test(); } diff --git a/crates/toml_edit/Cargo.toml b/crates/toml_edit/Cargo.toml index 492d4e23..03107fdd 100644 --- a/crates/toml_edit/Cargo.toml +++ b/crates/toml_edit/Cargo.toml @@ -46,7 +46,7 @@ serde_spanned = { version = "0.6.3", path = "../serde_spanned", features = ["ser [dev-dependencies] serde_json = "1.0.96" -toml-test-harness = "0.4.4" +toml-test-harness = "0.4.5" toml-test-data = "1.3.1" libtest-mimic = "0.6.0" snapbox = { version = "0.4.11", features = ["harness"] } diff --git a/crates/toml_edit/tests/decoder_compliance.rs b/crates/toml_edit/tests/decoder_compliance.rs index 0f0b3501..30861df1 100644 --- a/crates/toml_edit/tests/decoder_compliance.rs +++ b/crates/toml_edit/tests/decoder_compliance.rs @@ -5,13 +5,10 @@ fn main() { let mut harness = toml_test_harness::DecoderHarness::new(decoder); harness .ignore([ - "valid/spec/float-0.toml", // Test issue; `Decoder` turns `6.626e-34` into `0.0` - // Unreleased - "valid/string/escape-esc.toml", - "valid/string/hex-escape.toml", - "valid/datetime/no-seconds.toml", - "valid/inline-table/newline.toml", + "valid/spec/float-0.toml", + "invalid/inline-table/nested_key_conflict.toml", ]) .unwrap(); + harness.version("1.0.0"); harness.test(); } diff --git a/crates/toml_edit/tests/fixtures/invalid/encoding/bad-codepoint.stderr b/crates/toml_edit/tests/fixtures/invalid/encoding/bad-codepoint.stderr new file mode 100644 index 00000000..89ef2c79 --- /dev/null +++ b/crates/toml_edit/tests/fixtures/invalid/encoding/bad-codepoint.stderr @@ -0,0 +1 @@ +invalid utf-8 sequence of 1 bytes from index 29 \ No newline at end of file diff --git a/crates/toml_edit/tests/fixtures/invalid/float/exp-trailing-us.stderr b/crates/toml_edit/tests/fixtures/invalid/float/exp-trailing-us.stderr index 9a281849..b7e2ad9c 100644 --- a/crates/toml_edit/tests/fixtures/invalid/float/exp-trailing-us.stderr +++ b/crates/toml_edit/tests/fixtures/invalid/float/exp-trailing-us.stderr @@ -1,5 +1,6 @@ -TOML parse error at line 1, column 21 +TOML parse error at line 1, column 24 | -1 | exp-trailing-us = 1e_23_ - | ^ +1 | exp-trailing-us = 1e23_ + | ^ invalid floating-point number +expected digit diff --git a/crates/toml_edit/tests/fixtures/invalid/float/inf-capital.stderr b/crates/toml_edit/tests/fixtures/invalid/float/inf-capital.stderr new file mode 100644 index 00000000..ca7a1b1b --- /dev/null +++ b/crates/toml_edit/tests/fixtures/invalid/float/inf-capital.stderr @@ -0,0 +1,6 @@ +TOML parse error at line 1, column 5 + | +1 | v = Inf + | ^ +invalid string +expected `"`, `'` diff --git a/crates/toml_edit/tests/fixtures/invalid/float/nan-capital.stderr b/crates/toml_edit/tests/fixtures/invalid/float/nan-capital.stderr new file mode 100644 index 00000000..ae3b4d95 --- /dev/null +++ b/crates/toml_edit/tests/fixtures/invalid/float/nan-capital.stderr @@ -0,0 +1,6 @@ +TOML parse error at line 1, column 5 + | +1 | v = NaN + | ^ +invalid string +expected `"`, `'` diff --git a/crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp-1.stderr b/crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp-1.stderr new file mode 100644 index 00000000..cf0fabc7 --- /dev/null +++ b/crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp-1.stderr @@ -0,0 +1,6 @@ +TOML parse error at line 1, column 23 + | +1 | trailing-us-exp-1 = 1_e2 + | ^ +invalid integer +expected digit diff --git a/crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp-2.stderr b/crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp-2.stderr new file mode 100644 index 00000000..83ff1208 --- /dev/null +++ b/crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp-2.stderr @@ -0,0 +1,6 @@ +TOML parse error at line 1, column 25 + | +1 | trailing-us-exp-2 = 1.2_e2 + | ^ +invalid floating-point number +expected digit, digit diff --git a/crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp.stderr b/crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp.stderr deleted file mode 100644 index 811f951e..00000000 --- a/crates/toml_edit/tests/fixtures/invalid/float/trailing-us-exp.stderr +++ /dev/null @@ -1,6 +0,0 @@ -TOML parse error at line 2, column 21 - | -2 | trailing-us-exp = 1_e2 - | ^ -invalid integer -expected digit diff --git a/crates/toml_edit/tests/fixtures/invalid/inline-table/bad-key-syntax.stderr b/crates/toml_edit/tests/fixtures/invalid/inline-table/bad-key-syntax.stderr new file mode 100644 index 00000000..c8ce45a6 --- /dev/null +++ b/crates/toml_edit/tests/fixtures/invalid/inline-table/bad-key-syntax.stderr @@ -0,0 +1,6 @@ +TOML parse error at line 1, column 14 + | +1 | tbl = { a = 1, [b] } + | ^ +invalid inline table +expected `}` diff --git a/crates/toml_edit/tests/fixtures/invalid/inline-table/dotted-key-conflict.stderr b/crates/toml_edit/tests/fixtures/invalid/inline-table/dotted-key-conflict.stderr new file mode 100644 index 00000000..7b860448 --- /dev/null +++ b/crates/toml_edit/tests/fixtures/invalid/inline-table/dotted-key-conflict.stderr @@ -0,0 +1,5 @@ +TOML parse error at line 1, column 8 + | +1 | tbl = { a.b = "a_b", a.b.c = "a_b_c" } + | ^ +dotted key `a.b` attempted to extend non-table type (string) diff --git a/crates/toml_edit/tests/fixtures/invalid/inline-table/nested_key_conflict.stderr b/crates/toml_edit/tests/fixtures/invalid/inline-table/nested_key_conflict.stderr new file mode 100644 index 00000000..e69de29b diff --git a/crates/toml_edit/tests/fixtures/invalid/table/append-to-array-with-dotted-keys.stderr b/crates/toml_edit/tests/fixtures/invalid/table/append-to-array-with-dotted-keys.stderr new file mode 100644 index 00000000..0fb4b2eb --- /dev/null +++ b/crates/toml_edit/tests/fixtures/invalid/table/append-to-array-with-dotted-keys.stderr @@ -0,0 +1,5 @@ +TOML parse error at line 4, column 1 + | +4 | b.y = 2 + | ^ +duplicate key `y` diff --git a/crates/toml_edit/tests/fixtures/invalid/table/duplicate-key-dotted-array.stderr b/crates/toml_edit/tests/fixtures/invalid/table/duplicate-key-dotted-array.stderr new file mode 100644 index 00000000..0cf32abe --- /dev/null +++ b/crates/toml_edit/tests/fixtures/invalid/table/duplicate-key-dotted-array.stderr @@ -0,0 +1,6 @@ +TOML parse error at line 4, column 1 + | +4 | [[fruit.apple]] + | ^ +invalid table header +duplicate key `apple` in table `fruit`