From b5bf8def91ac1b2f597d0a5063294afc99a099c0 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Thu, 1 Aug 2024 21:41:35 -0600 Subject: [PATCH] test: basic module test to resist breakage --- test/bld.nix | 1 + test/bld.res.nix | 47 +++++++++++++++++++ test/bld.sh | 9 ++++ test/bld/bar/mod.nix | 5 ++ test/bld/bar/next/mod.nix | 5 ++ test/bld/bum | 1 + test/bld/buzz/bar/mod.nix | 5 ++ test/bld/buzz/bar/next/mod.nix | 5 ++ test/bld/buzz/fuzz/bar/mod.nix | 5 ++ test/bld/buzz/fuzz/bar/next/mod.nix | 5 ++ test/bld/buzz/fuzz/mod.nix | 5 ++ test/bld/buzz/fuzz/next/mod.nix | 5 ++ test/bld/buzz/fuzz/wuzz/bar/mod.nix | 5 ++ test/bld/buzz/fuzz/wuzz/bar/next/mod.nix | 5 ++ test/bld/buzz/fuzz/wuzz/cuzz/bar/mod.nix | 5 ++ test/bld/buzz/fuzz/wuzz/cuzz/bar/next/mod.nix | 5 ++ test/bld/buzz/fuzz/wuzz/cuzz/mod.nix | 5 ++ test/bld/buzz/fuzz/wuzz/cuzz/next/mod.nix | 5 ++ test/bld/buzz/fuzz/wuzz/mod.nix | 5 ++ test/bld/buzz/fuzz/wuzz/next/mod.nix | 5 ++ test/bld/buzz/mod.nix | 5 ++ test/bld/buzz/next/mod.nix | 5 ++ test/bld/mod.nix | 7 +++ test/bld/next/mod.nix | 5 ++ 24 files changed, 160 insertions(+) create mode 100644 test/bld.nix create mode 100644 test/bld.res.nix create mode 100755 test/bld.sh create mode 100644 test/bld/bar/mod.nix create mode 100644 test/bld/bar/next/mod.nix create mode 100644 test/bld/bum create mode 100644 test/bld/buzz/bar/mod.nix create mode 100644 test/bld/buzz/bar/next/mod.nix create mode 100644 test/bld/buzz/fuzz/bar/mod.nix create mode 100644 test/bld/buzz/fuzz/bar/next/mod.nix create mode 100644 test/bld/buzz/fuzz/mod.nix create mode 100644 test/bld/buzz/fuzz/next/mod.nix create mode 100644 test/bld/buzz/fuzz/wuzz/bar/mod.nix create mode 100644 test/bld/buzz/fuzz/wuzz/bar/next/mod.nix create mode 100644 test/bld/buzz/fuzz/wuzz/cuzz/bar/mod.nix create mode 100644 test/bld/buzz/fuzz/wuzz/cuzz/bar/next/mod.nix create mode 100644 test/bld/buzz/fuzz/wuzz/cuzz/mod.nix create mode 100644 test/bld/buzz/fuzz/wuzz/cuzz/next/mod.nix create mode 100644 test/bld/buzz/fuzz/wuzz/mod.nix create mode 100644 test/bld/buzz/fuzz/wuzz/next/mod.nix create mode 100644 test/bld/buzz/mod.nix create mode 100644 test/bld/buzz/next/mod.nix create mode 100644 test/bld/mod.nix create mode 100644 test/bld/next/mod.nix diff --git a/test/bld.nix b/test/bld.nix new file mode 100644 index 0000000..d0ce5cf --- /dev/null +++ b/test/bld.nix @@ -0,0 +1 @@ +import ../. ./bld diff --git a/test/bld.res.nix b/test/bld.res.nix new file mode 100644 index 0000000..e3fd384 --- /dev/null +++ b/test/bld.res.nix @@ -0,0 +1,47 @@ +{ + bar = 3; + baz = 7; + buzz = { + bar = 3; + baz = 7; + foo = 1; + fuzz = { + bar = 5; + baz = 9; + foo = 1; + next = { + g = 5; + h = 8; + }; + wuzz = { + bar = 7; + baz = 11; + cuzz = { + bar = 3; + baz = 7; + foo = 1; + next = { + g = 5; + h = 8; + }; + }; + foo = 1; + next = { + g = 5; + h = 8; + }; + }; + }; + next = { + g = 5; + h = 8; + }; + }; + foo = 1; + next = { + g = 5; + h = 8; + }; + test = scopedImport {std = builtins;} "${../std/set/filterMap.nix}"; + x = builtins.readFile ./bld/bum; +} diff --git a/test/bld.sh b/test/bld.sh new file mode 100755 index 0000000..59b89ae --- /dev/null +++ b/test/bld.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +comp="$(nix eval -f ./bld.nix)" +res="$(nix eval -f ./bld.res.nix)" + + +if [[ "$comp" == "$res" ]]; then + echo "success" && exit 0 +fi +echo "failed" && exit 1 diff --git a/test/bld/bar/mod.nix b/test/bld/bar/mod.nix new file mode 100644 index 0000000..885c6ee --- /dev/null +++ b/test/bld/bar/mod.nix @@ -0,0 +1,5 @@ +{ + foo = 1; + bar = atom.foo + 2; + baz = self.bar + 4; +} diff --git a/test/bld/bar/next/mod.nix b/test/bld/bar/next/mod.nix new file mode 100644 index 0000000..d89f820 --- /dev/null +++ b/test/bld/bar/next/mod.nix @@ -0,0 +1,5 @@ +{ + + g = super.foo + 4; + h = self.g + 3; +} diff --git a/test/bld/bum b/test/bld/bum new file mode 100644 index 0000000..ce01362 --- /dev/null +++ b/test/bld/bum @@ -0,0 +1 @@ +hello diff --git a/test/bld/buzz/bar/mod.nix b/test/bld/buzz/bar/mod.nix new file mode 100644 index 0000000..885c6ee --- /dev/null +++ b/test/bld/buzz/bar/mod.nix @@ -0,0 +1,5 @@ +{ + foo = 1; + bar = atom.foo + 2; + baz = self.bar + 4; +} diff --git a/test/bld/buzz/bar/next/mod.nix b/test/bld/buzz/bar/next/mod.nix new file mode 100644 index 0000000..d89f820 --- /dev/null +++ b/test/bld/buzz/bar/next/mod.nix @@ -0,0 +1,5 @@ +{ + + g = super.foo + 4; + h = self.g + 3; +} diff --git a/test/bld/buzz/fuzz/bar/mod.nix b/test/bld/buzz/fuzz/bar/mod.nix new file mode 100644 index 0000000..885c6ee --- /dev/null +++ b/test/bld/buzz/fuzz/bar/mod.nix @@ -0,0 +1,5 @@ +{ + foo = 1; + bar = atom.foo + 2; + baz = self.bar + 4; +} diff --git a/test/bld/buzz/fuzz/bar/next/mod.nix b/test/bld/buzz/fuzz/bar/next/mod.nix new file mode 100644 index 0000000..d89f820 --- /dev/null +++ b/test/bld/buzz/fuzz/bar/next/mod.nix @@ -0,0 +1,5 @@ +{ + + g = super.foo + 4; + h = self.g + 3; +} diff --git a/test/bld/buzz/fuzz/mod.nix b/test/bld/buzz/fuzz/mod.nix new file mode 100644 index 0000000..e4e8ed3 --- /dev/null +++ b/test/bld/buzz/fuzz/mod.nix @@ -0,0 +1,5 @@ +{ + foo = 1; + bar = super.bar + 2; + baz = self.bar + 4; +} diff --git a/test/bld/buzz/fuzz/next/mod.nix b/test/bld/buzz/fuzz/next/mod.nix new file mode 100644 index 0000000..d89f820 --- /dev/null +++ b/test/bld/buzz/fuzz/next/mod.nix @@ -0,0 +1,5 @@ +{ + + g = super.foo + 4; + h = self.g + 3; +} diff --git a/test/bld/buzz/fuzz/wuzz/bar/mod.nix b/test/bld/buzz/fuzz/wuzz/bar/mod.nix new file mode 100644 index 0000000..885c6ee --- /dev/null +++ b/test/bld/buzz/fuzz/wuzz/bar/mod.nix @@ -0,0 +1,5 @@ +{ + foo = 1; + bar = atom.foo + 2; + baz = self.bar + 4; +} diff --git a/test/bld/buzz/fuzz/wuzz/bar/next/mod.nix b/test/bld/buzz/fuzz/wuzz/bar/next/mod.nix new file mode 100644 index 0000000..d89f820 --- /dev/null +++ b/test/bld/buzz/fuzz/wuzz/bar/next/mod.nix @@ -0,0 +1,5 @@ +{ + + g = super.foo + 4; + h = self.g + 3; +} diff --git a/test/bld/buzz/fuzz/wuzz/cuzz/bar/mod.nix b/test/bld/buzz/fuzz/wuzz/cuzz/bar/mod.nix new file mode 100644 index 0000000..885c6ee --- /dev/null +++ b/test/bld/buzz/fuzz/wuzz/cuzz/bar/mod.nix @@ -0,0 +1,5 @@ +{ + foo = 1; + bar = atom.foo + 2; + baz = self.bar + 4; +} diff --git a/test/bld/buzz/fuzz/wuzz/cuzz/bar/next/mod.nix b/test/bld/buzz/fuzz/wuzz/cuzz/bar/next/mod.nix new file mode 100644 index 0000000..d89f820 --- /dev/null +++ b/test/bld/buzz/fuzz/wuzz/cuzz/bar/next/mod.nix @@ -0,0 +1,5 @@ +{ + + g = super.foo + 4; + h = self.g + 3; +} diff --git a/test/bld/buzz/fuzz/wuzz/cuzz/mod.nix b/test/bld/buzz/fuzz/wuzz/cuzz/mod.nix new file mode 100644 index 0000000..885c6ee --- /dev/null +++ b/test/bld/buzz/fuzz/wuzz/cuzz/mod.nix @@ -0,0 +1,5 @@ +{ + foo = 1; + bar = atom.foo + 2; + baz = self.bar + 4; +} diff --git a/test/bld/buzz/fuzz/wuzz/cuzz/next/mod.nix b/test/bld/buzz/fuzz/wuzz/cuzz/next/mod.nix new file mode 100644 index 0000000..d89f820 --- /dev/null +++ b/test/bld/buzz/fuzz/wuzz/cuzz/next/mod.nix @@ -0,0 +1,5 @@ +{ + + g = super.foo + 4; + h = self.g + 3; +} diff --git a/test/bld/buzz/fuzz/wuzz/mod.nix b/test/bld/buzz/fuzz/wuzz/mod.nix new file mode 100644 index 0000000..e4e8ed3 --- /dev/null +++ b/test/bld/buzz/fuzz/wuzz/mod.nix @@ -0,0 +1,5 @@ +{ + foo = 1; + bar = super.bar + 2; + baz = self.bar + 4; +} diff --git a/test/bld/buzz/fuzz/wuzz/next/mod.nix b/test/bld/buzz/fuzz/wuzz/next/mod.nix new file mode 100644 index 0000000..d89f820 --- /dev/null +++ b/test/bld/buzz/fuzz/wuzz/next/mod.nix @@ -0,0 +1,5 @@ +{ + + g = super.foo + 4; + h = self.g + 3; +} diff --git a/test/bld/buzz/mod.nix b/test/bld/buzz/mod.nix new file mode 100644 index 0000000..d890562 --- /dev/null +++ b/test/bld/buzz/mod.nix @@ -0,0 +1,5 @@ +{ + foo = 1; + bar = super.foo + 2; + baz = self.bar + 4; +} diff --git a/test/bld/buzz/next/mod.nix b/test/bld/buzz/next/mod.nix new file mode 100644 index 0000000..d89f820 --- /dev/null +++ b/test/bld/buzz/next/mod.nix @@ -0,0 +1,5 @@ +{ + + g = super.foo + 4; + h = self.g + 3; +} diff --git a/test/bld/mod.nix b/test/bld/mod.nix new file mode 100644 index 0000000..d5fbf8d --- /dev/null +++ b/test/bld/mod.nix @@ -0,0 +1,7 @@ +{ + foo = 1; + bar = atom.foo + 2; + baz = self.bar + 4; + test = std.set.filterMap; + x = builtins.readFile "${self}/bum"; +} diff --git a/test/bld/next/mod.nix b/test/bld/next/mod.nix new file mode 100644 index 0000000..d89f820 --- /dev/null +++ b/test/bld/next/mod.nix @@ -0,0 +1,5 @@ +{ + + g = super.foo + 4; + h = self.g + 3; +}