From 0c19e6b56c1adc02583487147c75dc520c5c3f1e Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 8 Mar 2024 09:50:55 +0100 Subject: [PATCH] add test for inherit-from semantics (cherry picked from commit 8669c02468994887be91072ac58b1ee43380d354) Change-Id: If8513316bf4b4b559c5bb63842c856f016816802 --- 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 = []; } ]