From 677a8099340b721adc6596039cc95bd32f97c490 Mon Sep 17 00:00:00 2001 From: Brett Mayson Date: Wed, 27 Sep 2023 19:16:35 +0000 Subject: [PATCH] split up tests --- Cargo.lock | 132 +++++++++----------- libs/config/src/analyze/config.rs | 6 +- libs/config/tests/errors.rs | 9 +- libs/config/tests/errors/arrays/source.hpp | 2 - libs/config/tests/errors/arrays/stdout.ansi | 19 --- libs/config/tests/errors/simple/old.ansi | 58 --------- libs/config/tests/errors/simple/source.hpp | 18 --- libs/config/tests/errors/simple/stdout.ansi | 58 --------- 8 files changed, 70 insertions(+), 232 deletions(-) delete mode 100644 libs/config/tests/errors/arrays/source.hpp delete mode 100644 libs/config/tests/errors/arrays/stdout.ansi delete mode 100644 libs/config/tests/errors/simple/old.ansi delete mode 100644 libs/config/tests/errors/simple/source.hpp delete mode 100644 libs/config/tests/errors/simple/stdout.ansi diff --git a/Cargo.lock b/Cargo.lock index 6c022ac7..5999269c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,9 +54,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2135563fb5c609d2b2b87c1e8ce7bc41b0b45430fa9661f457981503dd5bf0" +checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" dependencies = [ "memchr", ] @@ -295,18 +295,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.4" +version = "4.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" +checksum = "824956d0dca8334758a5b7f7e50518d66ea319330cbceedcf76905c2f6ab30e3" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.4.4" +version = "4.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" +checksum = "122ec64120a49b4563ccaedcbea7818d069ed8e9aa6d829b82d8a4128936b2ab" dependencies = [ "anstream", "anstyle", @@ -452,16 +452,6 @@ dependencies = [ "itertools", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" version = "0.8.3" @@ -631,9 +621,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "flate2" @@ -758,9 +748,9 @@ checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "git2" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ef350ba88a33b4d524b1d1c79096c9ade5ef8c59395df0e60d1e1889414c0e" +checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" dependencies = [ "bitflags 2.4.0", "libc", @@ -887,7 +877,7 @@ version = "1.0.1" dependencies = [ "byteorder", "hemtt-common", - "indexmap 2.0.0", + "indexmap 2.0.1", "serde", "sha-1", ] @@ -927,9 +917,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hmac" @@ -1033,9 +1023,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "ad227c3af19d4914570ad36d30409928b75967c298feb9ea1969db3a610bb14e" dependencies = [ "equivalent", "hashbrown 0.14.0", @@ -1471,9 +1461,9 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" dependencies = [ "memchr", "thiserror", @@ -1482,9 +1472,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" +checksum = "35513f630d46400a977c4cb58f78e1bfbe01434316e60c37d27b9ad6139c66d8" dependencies = [ "pest", "pest_generator", @@ -1492,9 +1482,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" +checksum = "bc9fc1b9e7057baba189b5c626e2d6f40681ae5b6eb064dc7c7834101ec8123a" dependencies = [ "pest", "pest_meta", @@ -1505,9 +1495,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" +checksum = "1df74e9e7ec4053ceb980e7c0c8bd3594e977fde1af91daba9c928e8e8c6708d" dependencies = [ "once_cell", "pest", @@ -1652,9 +1642,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -1662,14 +1652,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -1769,9 +1757,9 @@ dependencies = [ [[package]] name = "rhai" -version = "1.16.1" +version = "1.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637a4f79f65571b1fd1a0ebbae05bbbf58a01faf612abbc3eea15cda34f0b87a" +checksum = "206cee941730eaf90a22c84235b25193df661393688162e15551164f92f09eca" dependencies = [ "ahash 0.8.3", "bitflags 2.4.0", @@ -1858,9 +1846,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" dependencies = [ "bitflags 2.4.0", "errno", @@ -1924,9 +1912,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" [[package]] name = "serde" @@ -2004,9 +1992,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -2015,9 +2003,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -2060,9 +2048,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "smartstring" @@ -2181,18 +2169,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", @@ -2211,9 +2199,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa", @@ -2224,15 +2212,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] @@ -2299,9 +2287,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -2313,9 +2301,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c226a7bba6d859b63c92c4b4fe69c5b6b72d0cb897dbc8e6012298e6154cb56e" +checksum = "1bc1433177506450fe920e46a4f9812d0c211f5dd556da10e731a0a3dfa151f0" dependencies = [ "serde", "serde_spanned", @@ -2334,11 +2322,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff63e60a958cefbb518ae1fd6566af80d9d4be430a33f3723dfc47d1d411d95" +checksum = "ca676d9ba1a322c1b64eb8045a5ec5c0cfb0c9d08e15e9ff622589ad5221c8fe" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.1", "serde", "serde_spanned", "toml_datetime", @@ -2469,9 +2457,9 @@ checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "url" @@ -2644,9 +2632,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] diff --git a/libs/config/src/analyze/config.rs b/libs/config/src/analyze/config.rs index 6316bd99..477387ed 100644 --- a/libs/config/src/analyze/config.rs +++ b/libs/config/src/analyze/config.rs @@ -24,7 +24,7 @@ impl Analyze for Config { .flat_map(|p| p.warnings(processed)) .collect::>(); let mut defined = HashMap::new(); - warnings.extend(external_missing_warn(&self.0, &mut defined)); + warnings.extend(external_parent_case_warn(&self.0, &mut defined)); warnings } @@ -76,7 +76,7 @@ fn external_missing_error( errors } -fn external_missing_warn( +fn external_parent_case_warn( properties: &[Property], defined: &mut HashMap, ) -> Vec> { @@ -110,7 +110,7 @@ fn external_missing_warn( } } defined.insert(name_lower, c.clone()); - warnings.extend(external_missing_warn(properties, defined)); + warnings.extend(external_parent_case_warn(properties, defined)); } } } diff --git a/libs/config/tests/errors.rs b/libs/config/tests/errors.rs index e8d86b03..2a0e8a96 100644 --- a/libs/config/tests/errors.rs +++ b/libs/config/tests/errors.rs @@ -55,6 +55,11 @@ fn check(dir: &str) { } } -bootstrap!(simple); -bootstrap!(arrays); +bootstrap!(ce1_invalid_value); +bootstrap!(ce2_invalid_value_macro); +bootstrap!(ce3_duplicate_property_separate); +bootstrap!(ce3_duplicate_property_shadow_property); +bootstrap!(ce4_missing_semicolon); +bootstrap!(ce5_unexpected_array); +bootstrap!(ce6_expected_array); bootstrap!(ce7_missing_parent); diff --git a/libs/config/tests/errors/arrays/source.hpp b/libs/config/tests/errors/arrays/source.hpp deleted file mode 100644 index 0981e0f9..00000000 --- a/libs/config/tests/errors/arrays/source.hpp +++ /dev/null @@ -1,2 +0,0 @@ -not_array[] = "hello"; -array = {1,2,3}; diff --git a/libs/config/tests/errors/arrays/stdout.ansi b/libs/config/tests/errors/arrays/stdout.ansi deleted file mode 100644 index b430a764..00000000 --- a/libs/config/tests/errors/arrays/stdout.ansi +++ /dev/null @@ -1,19 +0,0 @@ -[CE6] Error: property was expected to be an array - ╭─[/source.hpp:1:1] - │ - 1 │ not_array[] = "hello"; -  │ ─┬ ───┬─── -  │ ╰──────────── `[]` indicates an upcoming array -  │ │ -  │ ╰───── expected array -───╯ - -[CE5] Error: property was not expected to be an array - ╭─[/source.hpp:2:9] - │ - 2 │ array = {1,2,3}; -  │ ──┬── ───┬─── -  │ ╰────────────── expected `array[]` here -  │ │ -  │ ╰───── unexpected array -───╯ diff --git a/libs/config/tests/errors/simple/old.ansi b/libs/config/tests/errors/simple/old.ansi deleted file mode 100644 index 100dd489..00000000 --- a/libs/config/tests/errors/simple/old.ansi +++ /dev/null @@ -1,58 +0,0 @@ -[CE1] Error: property's value could not be parsed. - ╭─[/source.hpp:6:12] - │ - 6 │     data = something; -  │ ────┬──── -  │ ╰────── invalid value -  │ -  │ Help: use quotes `"` around the value, or a QUOTE macro if it contains #define values -───╯ - -[CE2] Error: macro's result could not be parsed - ╭─[/source.hpp:7:12] - │ - 7 │     path = PATHTO(thing); -  │ ───┬── -  │ ╰──── invalid macro result -  │ -  │ Help: perhaps this macro has a `Q_` variant or you need `QUOTE(..)` -  │ -  │ Note: The processed output was `\some\thing` -───╯ - -[CE4] Error: property is missing a semicolon - ╭─[/source.hpp:8:22] - │ - 8 │     data = "something" -  │ ─┬ -  │ ╰── missing semicolon -  │ -  │ Help: add a semicolon `;` to the end of the property -───╯ - -[CE3] Error: property was defined more than once - ╭─[/source.hpp:13:9] - │ - 13 │         data = "something"; -  │ ──┬─ -  │ ╰─── first defined here -  │ - 16 │         data = "something"; -  │ ──┬─ -  │ ╰─── also defined here -────╯ - -[CE3] Error: property was defined more than once - ╭─[/source.hpp:6:5] - │ - 6 │     data = something; -  │ ──┬─ -  │ ╰─── first defined here -  │ - 8 │     data = "something" -  │ ──┬─ -  │ ╰─── also defined here - 9 │     class data { -  │ ──┬─ -  │ ╰─── also defined here -───╯ diff --git a/libs/config/tests/errors/simple/source.hpp b/libs/config/tests/errors/simple/source.hpp deleted file mode 100644 index 9230781d..00000000 --- a/libs/config/tests/errors/simple/source.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#define QUOTE(x) #x -#define PATHTO(x) \some\x -#define QPATHTO(x) QUOTE(PATHTO(x)) - -class Test { - outer = something; - path = PATHTO(thing); - outer = "nosemi" - class outer { - inner = "something"; - }; - class Child { - inner = "something"; - }; - class Child { - inner = "something"; - }; -}; diff --git a/libs/config/tests/errors/simple/stdout.ansi b/libs/config/tests/errors/simple/stdout.ansi deleted file mode 100644 index f3da9744..00000000 --- a/libs/config/tests/errors/simple/stdout.ansi +++ /dev/null @@ -1,58 +0,0 @@ -[CE1] Error: property's value could not be parsed. - ╭─[/source.hpp:6:13] - │ - 6 │     outer = something; -  │ ────┬──── -  │ ╰────── invalid value -  │ -  │ Help: use quotes `"` around the value, or a QUOTE macro if it contains #define values -───╯ - -[CE2] Error: macro's result could not be parsed - ╭─[/source.hpp:7:12] - │ - 7 │     path = PATHTO(thing); -  │ ───┬── -  │ ╰──── invalid macro result -  │ -  │ Help: perhaps this macro has a `Q_` variant or you need `QUOTE(..)` -  │ -  │ Note: The processed output was `\some\thing` -───╯ - -[CE4] Error: property is missing a semicolon - ╭─[/source.hpp:8:21] - │ - 8 │     outer = "nosemi" -  │ ┬ -  │ ╰── missing semicolon -  │ -  │ Help: add a semicolon `;` to the end of the property -───╯ - -[CE3] Error: property was defined more than once - ╭─[/source.hpp:6:5] - │ - 6 │     outer = something; -  │ ──┬── -  │ ╰──── first defined here -  │ - 8 │     outer = "nosemi" -  │ ──┬── -  │ ╰──── also defined here - 9 │     class outer { -  │ ──┬── -  │ ╰──── also defined here -───╯ - -[CE3] Error: property was defined more than once - ╭─[/source.hpp:13:9] - │ - 13 │         inner = "something"; -  │ ──┬── -  │ ╰──── first defined here -  │ - 16 │         inner = "something"; -  │ ──┬── -  │ ╰──── also defined here -────╯