From 8669c02468994887be91072ac58b1ee43380d354 Mon Sep 17 00:00:00 2001 From: pennae Date: Sat, 27 Jan 2024 16:33:34 +0100 Subject: [PATCH] add test for inherit-from semantics --- tests/functional/lang/eval-okay-inherit-from.err.exp | 2 ++ tests/functional/lang/eval-okay-inherit-from.exp | 1 + tests/functional/lang/eval-okay-inherit-from.nix | 6 ++++++ 3 files changed, 9 insertions(+) create mode 100644 tests/functional/lang/eval-okay-inherit-from.err.exp create mode 100644 tests/functional/lang/eval-okay-inherit-from.exp create mode 100644 tests/functional/lang/eval-okay-inherit-from.nix diff --git a/tests/functional/lang/eval-okay-inherit-from.err.exp b/tests/functional/lang/eval-okay-inherit-from.err.exp new file mode 100644 index 000000000..51881205b --- /dev/null +++ b/tests/functional/lang/eval-okay-inherit-from.err.exp @@ -0,0 +1,2 @@ +trace: used +trace: used diff --git a/tests/functional/lang/eval-okay-inherit-from.exp b/tests/functional/lang/eval-okay-inherit-from.exp new file mode 100644 index 000000000..43bd0e899 --- /dev/null +++ b/tests/functional/lang/eval-okay-inherit-from.exp @@ -0,0 +1 @@ +[ 1 2 { __overrides = { y = { d = [ ]; }; }; c = [ ]; d = 4; x = { c = [ ]; }; y = «repeated»; } ] diff --git a/tests/functional/lang/eval-okay-inherit-from.nix b/tests/functional/lang/eval-okay-inherit-from.nix new file mode 100644 index 000000000..d1fad7d69 --- /dev/null +++ b/tests/functional/lang/eval-okay-inherit-from.nix @@ -0,0 +1,6 @@ +let + inherit (builtins.trace "used" { a = 1; b = 2; }) a b; + x.c = 3; + y.d = 4; +in + [ a b rec { x.c = []; inherit (x) c; inherit (y) d; __overrides.y.d = []; } ]