aboutsummaryrefslogtreecommitdiff
path: root/tests/repl.sh
blob: d360821f2c9ebafe73b758a43e5b867a562f47dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
source common.sh

replCmds="
simple = import ./simple.nix
:b simple
"

testRepl () {
    local nixArgs=("$@")
    local replOutput="$(nix repl "${nixArgs[@]}" <<< "$replCmds")"
    echo "$replOutput"
    local outPath=$(echo "$replOutput" |&
        grep -o -E "$NIX_STORE_DIR/\w*-simple")
    nix path-info "${nixArgs[@]}" "$outPath"
}

# Simple test, try building a drv
testRepl
# Same thing (kind-of), but with a remote store.
testRepl --store "$TEST_ROOT/store?real=$NIX_STORE_DIR"