about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-identifier-formatting.nix
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-09-09T06·38-0700
committerclbot <clbot@tvl.fyi>2023-09-15T00·00+0000
commit92566210097bf301e7f6651c161115a51598f20d (patch)
tree4bb119876e5214324b51203e2f18be8bd91cd159 /tvix/eval/src/tests/tvix_tests/eval-okay-identifier-formatting.nix
parent95ee688f0338a080b039de6e971bc91ba133a863 (diff)
fix(tvix/eval): update identifier quoting to match cppnix 2.17 r/6589
In cppnix 2.17, commit b72bc4a972fe568744d98b89d63adcd504cb586c, the
libexpr pretty-printing routine was fixed so that it would no longer
pretty-print attrsets with keywords in their attrnames incorrectly.

This commit implements the corresponding fix for tvix, fixes our
tests to work with cppnix>=2.17 oracles, and expands our test cases
to cover all the keywords.

Change-Id: I4b51389cd3a9c44babc8ab2a84b383b7b0b116ca
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9283
Autosubmit: Adam Joseph <adam@westernsemico.com>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-identifier-formatting.nix')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-identifier-formatting.nix14
1 files changed, 13 insertions, 1 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-identifier-formatting.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-identifier-formatting.nix
index 8f9aa2823801..58af3d6d16ab 100644
--- a/tvix/eval/src/tests/tvix_tests/eval-okay-identifier-formatting.nix
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-identifier-formatting.nix
@@ -1,3 +1,6 @@
+# Note: the attribute values in this set aren't just dummies!  They
+# are booleans which indicate whether or not the corresponding
+# attrname is valid without quotification.
 {
   __internal = true;
   _internal = true;
@@ -15,7 +18,7 @@
   false = true;
   null = true;
   or = true;
-  "assert" = true; # -ish
+  "assert" = false;
   throw = true;
   abort = true;
 
@@ -27,4 +30,13 @@
   "'quoted'" = false;
   "_'12.5" = false;
   "😀" = false;
+
+  "if" = false;
+  "then" = false;
+  "else" = false;
+  "with" = false;
+  "let" = false;
+  "in" = false;
+  "rec" = false;
+  "inherit" = false;
 }