From 5ef26ccff10ef933166ad095797c006553229eb3 Mon Sep 17 00:00:00 2001 From: Nico Wagner Date: Sun, 9 Jul 2023 19:56:35 +0200 Subject: [PATCH] Condense snapshot tests --- pica-toolkit/tests/snapshot.rs | 92 ++++++---------------------------- 1 file changed, 16 insertions(+), 76 deletions(-) diff --git a/pica-toolkit/tests/snapshot.rs b/pica-toolkit/tests/snapshot.rs index 5da1ed4e3..3bd1eb9ce 100644 --- a/pica-toolkit/tests/snapshot.rs +++ b/pica-toolkit/tests/snapshot.rs @@ -1,90 +1,30 @@ #[test] -fn cat() { +fn cli_tests() { trycmd::TestCases::new() .case("tests/snapshot/cat/*.toml") - .case("tests/snapshot/cat/*.trycmd"); -} - -#[test] -fn completions() { - trycmd::TestCases::new() + .case("tests/snapshot/cat/*.trycmd") .case("tests/snapshot/completions/*.toml") - .case("tests/snapshot/completions/*.trycmd"); -} - -#[test] -fn count() { - trycmd::TestCases::new() + .case("tests/snapshot/completions/*.trycmd") .case("tests/snapshot/count/*.toml") - .case("tests/snapshot/count/*.trycmd"); -} - -#[test] -fn filter() { - trycmd::TestCases::new() + .case("tests/snapshot/count/*.trycmd") .case("tests/snapshot/filter/*.toml") - .case("tests/snapshot/filter/*.trycmd"); -} - -#[test] -fn frequency() { - trycmd::TestCases::new() + .case("tests/snapshot/filter/*.trycmd") .case("tests/snapshot/frequency/*.toml") - .case("tests/snapshot/frequency/*.trycmd"); -} - -#[test] -fn invalid() { - trycmd::TestCases::new() + .case("tests/snapshot/frequency/*.trycmd") + .case("tests/snapshot/hash/*.toml") + .case("tests/snapshot/hash/*.trycmd") .case("tests/snapshot/invalid/*.toml") - .case("tests/snapshot/invalid/*.trycmd"); -} - -#[test] -fn partition() { - trycmd::TestCases::new() + .case("tests/snapshot/invalid/*.trycmd") .case("tests/snapshot/partition/*.toml") - .case("tests/snapshot/partition/*.trycmd"); -} - -#[test] -fn select() { - trycmd::TestCases::new() + .case("tests/snapshot/partition/*.trycmd") + .case("tests/snapshot/print/*.toml") + .case("tests/snapshot/print/*.trycmd") + .case("tests/snapshot/sample/*.toml") + .case("tests/snapshot/sample/*.trycmd") .case("tests/snapshot/select/*.toml") - .case("tests/snapshot/select/*.trycmd"); -} - -#[test] -fn slice() { - trycmd::TestCases::new() + .case("tests/snapshot/select/*.trycmd") .case("tests/snapshot/slice/*.toml") - .case("tests/snapshot/slice/*.trycmd"); -} - -#[test] -fn split() { - trycmd::TestCases::new() + .case("tests/snapshot/slice/*.trycmd") .case("tests/snapshot/split/*.toml") .case("tests/snapshot/split/*.trycmd"); } - -#[test] -fn hash() { - trycmd::TestCases::new() - .case("tests/snapshot/hash/*.toml") - .case("tests/snapshot/hash/*.trycmd"); -} - -#[test] -fn print() { - trycmd::TestCases::new() - .case("tests/snapshot/print/*.toml") - .case("tests/snapshot/print/*.trycmd"); -} - -#[test] -fn sample() { - trycmd::TestCases::new() - .case("tests/snapshot/sample/*.toml") - .case("tests/snapshot/sample/*.trycmd"); -}