diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-02-06 13:17:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-06 13:17:58 +0100 |
commit | 93293fc66b3c9130904eb274834f617b3fb2c1a9 (patch) | |
tree | e47f9ae8e12d2d1de60422437911a74170ec0925 /tests | |
parent | 9148be6bfc6c9f239a92afdcde6b8a854d55b54d (diff) | |
parent | 1daf1babf956cab98857db92de8829a1e7f2ae3e (diff) |
Merge pull request #6042 from pennae/fix-repl-a
fix nix repl not overriding existing bindings in :a
Diffstat (limited to 'tests')
-rw-r--r-- | tests/repl.sh | 23 |
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" |