1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-09 16:13:54 +02:00

Merge pull request #6042 from pennae/fix-repl-a

fix nix repl not overriding existing bindings in :a
This commit is contained in:
Eelco Dolstra 2022-02-06 13:17:58 +01:00 committed by GitHub
commit 93293fc66b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 4 deletions

View file

@ -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"