brewery
notashelf /
e6231f546d5752fc9afce4a0201b5db28957cd70

nixir

public

Import-resolving Nix IR plugin

Star0tarball
clone
ssh://git@git.notashelf.dev:33/notashelf/nixir.git

Commit e6231f546d57

tarball

NotAShelf <raf@notashelf.dev> · 2026-04-24 20:13 UTC

unverified21 files changed+144-0
tests: update test cases for newer syntax items; drop old artifacts

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8640148e8e7597924f9c776750c856266a6a6964
diff --git a/tests/ancient_let.nix b/tests/ancient_let.nixnew file mode 100644index 0000000..3d4cfec--- /dev/null+++ b/tests/ancient_let.nix@@ -0,0 +1,8 @@+# Test ancient let syntax: let { bindings; body = expr; }+# This is equivalent to: let bindings in expr, but has been deprecated+# in newer Nix versions.+let {+  x = 10;+  y = 20;+  body = x + y;+}diff --git a/tests/attrset.nixir b/tests/attrset.nixirdeleted file mode 100644index 708f5dd..0000000Binary files a/tests/attrset.nixir and /dev/null differdiff --git a/tests/block_comments.nix b/tests/block_comments.nixnew file mode 100644index 0000000..b5de60f--- /dev/null+++ b/tests/block_comments.nix@@ -0,0 +1,12 @@+# Test block comments /* */+/* This is a block comment */+let+  x = 42; /* inline block comment */+  /* Multi-line+     block+     comment */+  y = 100;+in+/* Comment before expression */+x + y+/* Trailing comment */diff --git a/tests/comparison.nixir b/tests/comparison.nixirdeleted file mode 100644index fb7b4fd..0000000Binary files a/tests/comparison.nixir and /dev/null differdiff --git a/tests/dynamic_attrs.nix b/tests/dynamic_attrs.nixnew file mode 100644index 0000000..3c32fd5--- /dev/null+++ b/tests/dynamic_attrs.nix@@ -0,0 +1,15 @@+# Test dynamic attribute names+# Note: Full dynamic attrs require runtime evaluation+# For now, testing that syntax is recognized+let+  key = "mykey";+in {+  # Static attribute for comparison+  static = "value";++  # Dynamic attribute name (basic string interpolation)+  # "${key}" = "dynamic_value";++  # For now, use workaround with static names+  mykey = "works";+}diff --git a/tests/home_path.nix b/tests/home_path.nixnew file mode 100644index 0000000..ccfb107--- /dev/null+++ b/tests/home_path.nix@@ -0,0 +1,11 @@+# Test home-relative paths+# Note: This will resolve to the actual home directory at evaluation time+let+  # Example home path (will be expanded by evaluator)+  config = ~/..config;+  file = ~/.bashrc;+in {+  # These are just path values that will be expanded+  configPath = config;+  filePath = file;+}diff --git a/tests/if.nixir b/tests/if.nixirdeleted file mode 100644index 4ee0f59..0000000Binary files a/tests/if.nixir and /dev/null differdiff --git a/tests/indented_string.nix b/tests/indented_string.nixnew file mode 100644index 0000000..16c6026--- /dev/null+++ b/tests/indented_string.nix@@ -0,0 +1,31 @@+# Test indented strings (multi-line strings with '' delimiters)+let+  # Simple indented string+  simple = ''+    Hello+    World+  '';++  # Indented string with interpolation+  name = "Nix";+  greeting = ''+    Welcome to ${name}!+    This is indented.+  '';++  # Escape sequences+  escapes = ''+    Literal dollar: ''$+    Literal quotes: '''+    Regular text+  '';++  # Shell script example (common use case)+  script = ''+    #!/bin/bash+    echo "Running script"+    ls -la+  '';+in {+  inherit simple greeting escapes script;+}diff --git a/tests/let.nixir b/tests/let.nixirdeleted file mode 100644index cb9dd41..0000000Binary files a/tests/let.nixir and /dev/null differdiff --git a/tests/list_concat.nix b/tests/list_concat.nixnew file mode 100644index 0000000..a1b09f1--- /dev/null+++ b/tests/list_concat.nix@@ -0,0 +1,15 @@+# Test list concatenation operator +++let+  list1 = [1 2 3];+  list2 = [4 5 6];+  empty = [];+in {+  # Basic concatenation+  combined = list1 ++ list2;++  # Concatenate with empty list+  with_empty = list1 ++ empty;++  # Nested concatenation+  triple = [1] ++ [2] ++ [3];+}diff --git a/tests/logical.nixir b/tests/logical.nixirdeleted file mode 100644index 010a5f5..0000000Binary files a/tests/logical.nixir and /dev/null differdiff --git a/tests/nested_attrs.nix b/tests/nested_attrs.nixnew file mode 100644index 0000000..874d08b--- /dev/null+++ b/tests/nested_attrs.nix@@ -0,0 +1,13 @@+# Test nested attribute paths+{+  # Simple nested path+  a.b.c = 42;++  # Multiple nested paths+  x.y = 1;+  x.z = 2;++  # Mix of nested and non-nested+  foo = "bar";+  nested.deep.value = 100;+}diff --git a/tests/operators.nixir b/tests/operators.nixirdeleted file mode 100644index f71f899..0000000Binary files a/tests/operators.nixir and /dev/null differdiff --git a/tests/or_in_attrset.nix b/tests/or_in_attrset.nixnew file mode 100644index 0000000..406149b--- /dev/null+++ b/tests/or_in_attrset.nix@@ -0,0 +1,6 @@+# Test 'or' in attrset context+let+  attrs = { a = 1; };+in {+  test = attrs.a or 999;+}diff --git a/tests/or_simple.nix b/tests/or_simple.nixnew file mode 100644index 0000000..6025a4d--- /dev/null+++ b/tests/or_simple.nix@@ -0,0 +1,4 @@+# Simplest 'or' test+let+  x = { a = 1; };+in x.a or 2diff --git a/tests/path_concat.nix b/tests/path_concat.nixnew file mode 100644index 0000000..682175c--- /dev/null+++ b/tests/path_concat.nix@@ -0,0 +1,13 @@+# Test path concatenation+let+  # Path + string = path+  p1 = ./foo + "/bar";++  # String + path = path+  p2 = "/prefix" + ./suffix;++  # Path + path = path+  p3 = ./dir + ./file;+in {+  inherit p1 p2 p3;+}diff --git a/tests/precedence.nixir b/tests/precedence.nixirdeleted file mode 100644index de1b0d4..0000000Binary files a/tests/precedence.nixir and /dev/null differdiff --git a/tests/select_or_default.nix b/tests/select_or_default.nixnew file mode 100644index 0000000..df91875--- /dev/null+++ b/tests/select_or_default.nix@@ -0,0 +1,16 @@+# Test selection with 'or' default+let+  attrs = { a = 1; b = 2; };+in {+  # Attribute exists - should use value from attrs+  has_attr = attrs.a or 999;++  # Attribute doesn't exist - should use default+  missing_attr = attrs.c or 100;++  # Nested default expression+  nested = attrs.d or (attrs.a + attrs.b);++  # Default with literal+  with_string = attrs.name or "default_name";+}diff --git a/tests/simple.nixir b/tests/simple.nixirdeleted file mode 100644index 3e26f83..0000000Binary files a/tests/simple.nixir and /dev/null differdiff --git a/tests/simple_op.nixir b/tests/simple_op.nixirdeleted file mode 100644index 18ffbd3..0000000Binary files a/tests/simple_op.nixir and /dev/null differdiff --git a/tests/unary.nixir b/tests/unary.nixirdeleted file mode 100644index 652fabc..0000000Binary files a/tests/unary.nixir and /dev/null differ