aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2022-02-04 07:36:56 +0100
committerpennae <github@quasiparticle.net>2022-02-04 15:27:59 +0100
commit1daf1babf956cab98857db92de8829a1e7f2ae3e (patch)
tree719be8f62520bff68378037c84aa17c0862f32ac /tests
parentfcb33440b6d3038e6761e546fc9434fa8e9a1666 (diff)
fix nix repl not overriding existing bindings in :a
previously :a would override old bindings of a name with new values if the added set contained names that were already bound. in nix 2.6 this doesn't happen any more, which is potentially confusing. fixes #6041
Diffstat (limited to 'tests')
-rw-r--r--tests/repl.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/repl.sh b/tests/repl.sh
index 0e23a98db..6505f1741 100644
--- a/tests/repl.sh
+++ b/tests/repl.sh
@@ -40,3 +40,26 @@ testRepl () {
testRepl
# Same thing (kind-of), but with a remote store.
testRepl --store "$TEST_ROOT/store?real=$NIX_STORE_DIR"
+
+testReplResponse () {
+ local response="$(nix repl <<< "$1")"
+ echo "$response" | grep -qs "$2" \
+ || fail "repl command set:
+
+$1
+
+does not respond with:
+
+$2
+
+but with:
+
+$response"
+}
+
+# :a uses the newest version of a symbol
+testReplResponse '
+:a { a = "1"; }
+:a { a = "2"; }
+"result: ${a}"
+' "result: 2"