From 4ec43bed5e1f6077402301aeee125870f755267b Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 25 Oct 2022 01:56:42 -0700 Subject: fix(tvix/eval): quote keys which are not valid identifiers The impl Display for NixAttrs needs to wrap double quotes around any keys which are not valid Nix identifiers. This commit does that, and adds a test (which fails prior to this commit and passes after this commit). Change-Id: Ie31ce91e8637cb27073f23f115db81feefdc6424 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7084 Autosubmit: Adam Joseph Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.nix | 1 + 2 files changed, 2 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.nix (limited to 'tvix/eval/src/tests/tvix_tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.exp new file mode 100644 index 0000000000..aa98a082a8 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.exp @@ -0,0 +1 @@ +{ "3" = 3; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.nix new file mode 100644 index 0000000000..aa98a082a8 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-escapify-integer-keys.nix @@ -0,0 +1 @@ +{ "3" = 3; } -- cgit 1.4.1