From aa17362d95be2ccca5fbc6b7c62d8d6c365c82a9 Mon Sep 17 00:00:00 2001 From: o3o Date: Wed, 7 Jun 2023 11:16:30 +0200 Subject: [PATCH] test: add valid tests --- tests/ut/toml.d | 1 + tests/ut/valid.d | 24 ++++++++++++++++++++++++ tests/ut_main.d | 1 + 3 files changed, 26 insertions(+) create mode 100644 tests/ut/valid.d diff --git a/tests/ut/toml.d b/tests/ut/toml.d index 2499142..024256c 100644 --- a/tests/ut/toml.d +++ b/tests/ut/toml.d @@ -103,6 +103,7 @@ unittest { doc["bare-key"].should == "value"; doc["1234"].should == "value"; } + @("quoted keys") @safe unittest { diff --git a/tests/ut/valid.d b/tests/ut/valid.d new file mode 100644 index 0000000..5a03041 --- /dev/null +++ b/tests/ut/valid.d @@ -0,0 +1,24 @@ +module ut.valid; + +import unit_threaded; +import toml; + + +@("issue5") +@ShouldFail("to be fixed: see https://github.com/dlang-community/toml/issues/5") +@safe +unittest { + enum T =` + [[override]] + a = 30 + + [override.symbols] + "S.f" = 30 + + [[override]] + a = 40 + + [override.symbols] + "S.f" = 25 `; + TOMLDocument doc = parseTOML(T); +} diff --git a/tests/ut_main.d b/tests/ut_main.d index 8805bd3..7a64702 100644 --- a/tests/ut_main.d +++ b/tests/ut_main.d @@ -4,6 +4,7 @@ int main(string[] args) { return runTests!( "ut.toml", "ut.invalid", + "ut.valid", "toml.serialize", "toml.toml", )(args);