From d84bc45e176163d3ce3cae33422b9f7973def540 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 14 Aug 2025 18:39:41 +0100 Subject: [PATCH] tests/functional2/lang: add test for underflowing JSON number literal Change-Id: I6a6a6964c49a82244f7c0062c27ec9a5feadd910 --- .../{eval-fail.err.exp => eval-fail-overflow.err.exp} | 0 .../lang/fromJSON-overflowing/eval-okay-underflow.out.exp | 1 + .../lang/fromJSON-overflowing/{in.nix => in-overflow.nix} | 0 tests/functional2/lang/fromJSON-overflowing/in-underflow.nix | 1 + 4 files changed, 2 insertions(+) rename tests/functional2/lang/fromJSON-overflowing/{eval-fail.err.exp => eval-fail-overflow.err.exp} (100%) create mode 100644 tests/functional2/lang/fromJSON-overflowing/eval-okay-underflow.out.exp rename tests/functional2/lang/fromJSON-overflowing/{in.nix => in-overflow.nix} (100%) create mode 100644 tests/functional2/lang/fromJSON-overflowing/in-underflow.nix diff --git a/tests/functional2/lang/fromJSON-overflowing/eval-fail.err.exp b/tests/functional2/lang/fromJSON-overflowing/eval-fail-overflow.err.exp similarity index 100% rename from tests/functional2/lang/fromJSON-overflowing/eval-fail.err.exp rename to tests/functional2/lang/fromJSON-overflowing/eval-fail-overflow.err.exp diff --git a/tests/functional2/lang/fromJSON-overflowing/eval-okay-underflow.out.exp b/tests/functional2/lang/fromJSON-overflowing/eval-okay-underflow.out.exp new file mode 100644 index 000000000..1f835a11b --- /dev/null +++ b/tests/functional2/lang/fromJSON-overflowing/eval-okay-underflow.out.exp @@ -0,0 +1 @@ +{ attr = -9.22337e+18; } diff --git a/tests/functional2/lang/fromJSON-overflowing/in.nix b/tests/functional2/lang/fromJSON-overflowing/in-overflow.nix similarity index 100% rename from tests/functional2/lang/fromJSON-overflowing/in.nix rename to tests/functional2/lang/fromJSON-overflowing/in-overflow.nix diff --git a/tests/functional2/lang/fromJSON-overflowing/in-underflow.nix b/tests/functional2/lang/fromJSON-overflowing/in-underflow.nix new file mode 100644 index 000000000..005403f98 --- /dev/null +++ b/tests/functional2/lang/fromJSON-overflowing/in-underflow.nix @@ -0,0 +1 @@ +builtins.fromJSON ''{"attr": -9223372036854775809}''