summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/no_shards/by-name/a/file.nix0
-rw-r--r--tests/no_shards/by-name/a/other.nix0
-rw-r--r--tests/no_shards/by-name/b/file.nix0
-rw-r--r--tests/no_shards/by-name/b/nothing.lix0
-rw-r--r--tests/no_shards/by-name/c/file.nix0
-rw-r--r--tests/no_shards/by-name/empty/file.other0
-rw-r--r--tests/no_shards/by-name/tripwire.test0
-rw-r--r--tests/no_shards/test.nix9
-rw-r--r--tests/shards/by-name/em/empty/file.other0
-rw-r--r--tests/shards/by-name/fi/first/file.nix0
-rw-r--r--tests/shards/by-name/fi/first/other.nix0
-rw-r--r--tests/shards/by-name/se/second/file.nix0
-rw-r--r--tests/shards/by-name/se/second/nothing.lix0
-rw-r--r--tests/shards/by-name/th/third/file.nix0
-rw-r--r--tests/shards/by-name/tripwire.test0
-rw-r--r--tests/shards/test.nix9
-rw-r--r--tests/shards_finalize/by-name/em/empty/file.other0
-rw-r--r--tests/shards_finalize/by-name/fi/first/file.nix0
-rw-r--r--tests/shards_finalize/by-name/fi/first/other.nix0
-rw-r--r--tests/shards_finalize/by-name/se/second/file.nix0
-rw-r--r--tests/shards_finalize/by-name/se/second/nothing.lix0
-rw-r--r--tests/shards_finalize/by-name/th/third/file.nix0
-rw-r--r--tests/shards_finalize/by-name/tripwire.test0
-rw-r--r--tests/shards_finalize/test.nix9
-rw-r--r--tests/shards_relative/by-name/em/empty/file.other0
-rw-r--r--tests/shards_relative/by-name/fi/first/file.nix0
-rw-r--r--tests/shards_relative/by-name/fi/first/other.nix0
-rw-r--r--tests/shards_relative/by-name/se/second/file.nix0
-rw-r--r--tests/shards_relative/by-name/se/second/nothing.lix0
-rw-r--r--tests/shards_relative/by-name/th/third/file.nix0
-rw-r--r--tests/shards_relative/by-name/tripwire.test0
-rw-r--r--tests/shards_relative/test.nix9
32 files changed, 36 insertions, 0 deletions
diff --git a/tests/no_shards/by-name/a/file.nix b/tests/no_shards/by-name/a/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/no_shards/by-name/a/file.nix
diff --git a/tests/no_shards/by-name/a/other.nix b/tests/no_shards/by-name/a/other.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/no_shards/by-name/a/other.nix
diff --git a/tests/no_shards/by-name/b/file.nix b/tests/no_shards/by-name/b/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/no_shards/by-name/b/file.nix
diff --git a/tests/no_shards/by-name/b/nothing.lix b/tests/no_shards/by-name/b/nothing.lix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/no_shards/by-name/b/nothing.lix
diff --git a/tests/no_shards/by-name/c/file.nix b/tests/no_shards/by-name/c/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/no_shards/by-name/c/file.nix
diff --git a/tests/no_shards/by-name/empty/file.other b/tests/no_shards/by-name/empty/file.other
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/no_shards/by-name/empty/file.other
diff --git a/tests/no_shards/by-name/tripwire.test b/tests/no_shards/by-name/tripwire.test
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/no_shards/by-name/tripwire.test
diff --git a/tests/no_shards/test.nix b/tests/no_shards/test.nix
new file mode 100644
index 0000000..9bc25b5
--- /dev/null
+++ b/tests/no_shards/test.nix
@@ -0,0 +1,9 @@
+let
+  nixLib = import ../../default.nix {};
+in
+  nixLib.mkByName {
+    useShards = false;
+    baseDirectory = ./by-name;
+    # fileName = "file.nix";
+    fileRegex = ".*\.nix";
+  }
diff --git a/tests/shards/by-name/em/empty/file.other b/tests/shards/by-name/em/empty/file.other
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards/by-name/em/empty/file.other
diff --git a/tests/shards/by-name/fi/first/file.nix b/tests/shards/by-name/fi/first/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards/by-name/fi/first/file.nix
diff --git a/tests/shards/by-name/fi/first/other.nix b/tests/shards/by-name/fi/first/other.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards/by-name/fi/first/other.nix
diff --git a/tests/shards/by-name/se/second/file.nix b/tests/shards/by-name/se/second/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards/by-name/se/second/file.nix
diff --git a/tests/shards/by-name/se/second/nothing.lix b/tests/shards/by-name/se/second/nothing.lix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards/by-name/se/second/nothing.lix
diff --git a/tests/shards/by-name/th/third/file.nix b/tests/shards/by-name/th/third/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards/by-name/th/third/file.nix
diff --git a/tests/shards/by-name/tripwire.test b/tests/shards/by-name/tripwire.test
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards/by-name/tripwire.test
diff --git a/tests/shards/test.nix b/tests/shards/test.nix
new file mode 100644
index 0000000..6057b82
--- /dev/null
+++ b/tests/shards/test.nix
@@ -0,0 +1,9 @@
+let
+  nixLib = import ../../default.nix {};
+in
+  nixLib.mkByName {
+    useShards = true;
+    baseDirectory = ./by-name;
+    fileName = "file.nix";
+    # fileRegex = ".*\.nix";
+  }
diff --git a/tests/shards_finalize/by-name/em/empty/file.other b/tests/shards_finalize/by-name/em/empty/file.other
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_finalize/by-name/em/empty/file.other
diff --git a/tests/shards_finalize/by-name/fi/first/file.nix b/tests/shards_finalize/by-name/fi/first/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_finalize/by-name/fi/first/file.nix
diff --git a/tests/shards_finalize/by-name/fi/first/other.nix b/tests/shards_finalize/by-name/fi/first/other.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_finalize/by-name/fi/first/other.nix
diff --git a/tests/shards_finalize/by-name/se/second/file.nix b/tests/shards_finalize/by-name/se/second/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_finalize/by-name/se/second/file.nix
diff --git a/tests/shards_finalize/by-name/se/second/nothing.lix b/tests/shards_finalize/by-name/se/second/nothing.lix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_finalize/by-name/se/second/nothing.lix
diff --git a/tests/shards_finalize/by-name/th/third/file.nix b/tests/shards_finalize/by-name/th/third/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_finalize/by-name/th/third/file.nix
diff --git a/tests/shards_finalize/by-name/tripwire.test b/tests/shards_finalize/by-name/tripwire.test
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_finalize/by-name/tripwire.test
diff --git a/tests/shards_finalize/test.nix b/tests/shards_finalize/test.nix
new file mode 100644
index 0000000..0e6d5e0
--- /dev/null
+++ b/tests/shards_finalize/test.nix
@@ -0,0 +1,9 @@
+let
+  nixLib = import ../../default.nix {};
+in
+  nixLib.mkByName {
+    useShards = true;
+    baseDirectory = ./by-name;
+    fileName = "file.nix";
+    finalizeFunction = name: value: "${name}-${value}";
+  }
diff --git a/tests/shards_relative/by-name/em/empty/file.other b/tests/shards_relative/by-name/em/empty/file.other
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_relative/by-name/em/empty/file.other
diff --git a/tests/shards_relative/by-name/fi/first/file.nix b/tests/shards_relative/by-name/fi/first/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_relative/by-name/fi/first/file.nix
diff --git a/tests/shards_relative/by-name/fi/first/other.nix b/tests/shards_relative/by-name/fi/first/other.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_relative/by-name/fi/first/other.nix
diff --git a/tests/shards_relative/by-name/se/second/file.nix b/tests/shards_relative/by-name/se/second/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_relative/by-name/se/second/file.nix
diff --git a/tests/shards_relative/by-name/se/second/nothing.lix b/tests/shards_relative/by-name/se/second/nothing.lix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_relative/by-name/se/second/nothing.lix
diff --git a/tests/shards_relative/by-name/th/third/file.nix b/tests/shards_relative/by-name/th/third/file.nix
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_relative/by-name/th/third/file.nix
diff --git a/tests/shards_relative/by-name/tripwire.test b/tests/shards_relative/by-name/tripwire.test
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tests/shards_relative/by-name/tripwire.test
diff --git a/tests/shards_relative/test.nix b/tests/shards_relative/test.nix
new file mode 100644
index 0000000..1e91234
--- /dev/null
+++ b/tests/shards_relative/test.nix
@@ -0,0 +1,9 @@
+let
+  nixLib = import ../../default.nix {};
+in
+  nixLib.mkByName {
+    useShards = true;
+    baseDirectory = ./by-name;
+    fileName = "file.nix";
+    relativePaths = true;
+  }