From 259ec11d92633b417602c89082de49af77da260f Mon Sep 17 00:00:00 2001 From: Pacman99 Date: Sun, 28 Mar 2021 15:05:47 -0700 Subject: [PATCH] tests: init testSuites to test suites and profile processing --- tests/lib.nix | 20 ++++++++++++++++++++ tests/profiles/foo/default.nix | 3 +++ tests/profiles/t/default.nix | 0 3 files changed, 23 insertions(+) create mode 100644 tests/profiles/foo/default.nix create mode 100644 tests/profiles/t/default.nix diff --git a/tests/lib.nix b/tests/lib.nix index 65559f8..3b181cc 100644 --- a/tests/lib.nix +++ b/tests/lib.nix @@ -66,4 +66,24 @@ lib.runTests { (rgxToString "a?" "a" == "a") (rgxToString "hat" "foohatbar" == "hat") ]; + + testSuites = + let + profiles = os.mkProfileAttrs (toString ./profiles); + users = ""; + userProfiles = ""; + suites = { profiles, ... }: { + system.bar = [ profiles.foo ]; + }; + in + { + expr = os.mkSuites { inherit profiles users userProfiles suites; }; + expected = { + system = { + bar = [ profiles.foo.default ]; + allProfiles = [ profiles.foo.default profiles.t.default ]; + allUsers = []; + }; + }; + }; } diff --git a/tests/profiles/foo/default.nix b/tests/profiles/foo/default.nix new file mode 100644 index 0000000..2181e56 --- /dev/null +++ b/tests/profiles/foo/default.nix @@ -0,0 +1,3 @@ +{ + bar = 5; +} diff --git a/tests/profiles/t/default.nix b/tests/profiles/t/default.nix new file mode 100644 index 0000000..e69de29