tests/functional2/lang: add tests for NUL bytes in JSON and TOML

Based on the tests in the upstream PR.

Co-authored-by: Philipp Otterbein <potterbein@blockstream.com>
Upstream-PR: https://github.com/NixOS/nix/pull/12024
Change-Id: I6a6a69643ae9bd2445e551013d09e64ac1fe9916
This commit is contained in:
Emily
2025-08-14 22:19:29 +01:00
co-authored by Philipp Otterbein
parent 5359ab9a76
commit 860984be27
13 changed files with 19 additions and 0 deletions
@@ -0,0 +1 @@
{ k = "a"; }
@@ -0,0 +1 @@
{ k = "a"; }
@@ -0,0 +1 @@
builtins.fromJSON ''{"a\u0000b": 1}''
@@ -0,0 +1 @@
builtins.fromJSON ''"a\u0000b"''
@@ -0,0 +1 @@
builtins.fromTOML ''"a\u0000b" = 1''
@@ -0,0 +1 @@
builtins.fromTOML ''k = "a\u0000b"''
@@ -0,0 +1,11 @@
[[test]]
name = "eval-depr"
matrix = true
# FIXME: These should fail.
runner = "eval-okay"
[[test]]
name = "eval-allow-depr"
matrix = true
runner = "eval-okay"
flags = ["--extra-deprecated-features", "nul-bytes"]