1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

Track doc comments and render them in :doc

This commit is contained in:
Robert Hensing 2024-07-08 17:39:26 +02:00
parent e5af7cbeb9
commit 7fae378835
25 changed files with 515 additions and 16 deletions

View file

@ -1,6 +1,7 @@
#!/usr/bin/env bash
source common.sh
source characterisation/framework.sh
testDir="$PWD"
cd "$TEST_ROOT"
@ -244,3 +245,32 @@ testReplResponseNoRegex '
y = { a = 1 };
}
'
# TODO: move init to characterisation/framework.sh
badDiff=0
badExitCode=0
nixVersion="$(nix eval --impure --raw --expr 'builtins.nixVersion' --extra-experimental-features nix-command)"
runRepl () {
# TODO: pass arguments to nix repl; see lang.sh
nix repl 2>&1 \
| stripColors \
| sed \
-e "s@$testDir@/path/to/tests/functional@g" \
-e "s@$nixVersion@<nix version>@g" \
-e "s@Added [0-9]* variables@Added <number omitted> variables@g" \
| grep -vF $'warning: you don\'t have Internet access; disabling some network-dependent features' \
;
}
for test in $(cd "$testDir/repl"; echo *.in); do
test="$(basename "$test" .in)"
in="$testDir/repl/$test.in"
actual="$testDir/repl/$test.actual"
expected="$testDir/repl/$test.expected"
(cd "$testDir/repl"; set +x; runRepl 2>&1) < "$in" > "$actual"
diffAndAcceptInner "$test" "$actual" "$expected"
done
characterisationTestExit