run-file () { local spec_name=$1; shift; local spec_file=spec/$spec_name.test.sh; local suite; suite=$(test/sh_spec.py --print-spec-suite $spec_file); local spec_subdir; case $suite in osh) spec_subdir='osh-cpp' ;; ysh) spec_subdir='ysh-cpp' ;; *) die "Invalid suite $suite" ;; esac; local base_dir=_tmp/spec/$spec_subdir; mkdir -v -p $base_dir; sh-spec $spec_file --timeout 10 --oils-bin-dir $PWD/bin --oils-cpp-bin-dir $REPO_ROOT/_bin/cxx-asan --tsv-output $base_dir/${spec_name}.tsv "$@" } builtin-cd: spec test case results

Results for builtin-cd.test.sh

statusoshosh-cpp
pass 1919
FAIL 11
total2020
caseoshosh-cppdescription
0pass pass cd and $PWD
1FAIL FAIL cd BAD/..
detailsdetails
2pass pass cd with 2 or more args
3pass pass $OLDPWD
4pass pass pwd
5pass pass pwd after cd ..
6pass pass pwd with symlink and -P
7pass pass setting $PWD doesn't affect the value of 'pwd' builtin
8pass pass unset PWD; then pwd
9pass pass 'unset PWD; pwd' before any cd (tickles a rare corner case)
10pass pass lie about PWD; pwd before any cd
11pass pass remove pwd dir
12pass pass pwd in symlinked dir on shell initialization
13pass pass Test the current directory after 'cd ..' involving symlinks
14pass pass cd with no arguments
15pass pass cd to nonexistent dir
16pass pass cd away from dir that was deleted
17pass pass cd permits double bare dash
18pass pass cd to symlink with -L and -P
19pass pass cd to relative path with -L and -P
38 passed, 0 OK, 0 not implemented, 0 BUG, 1 failed, 0 timeouts, 0 cases skipped
1 failed under osh

Details on runs that didn't PASS

osh1 cd BAD/..

[osh stdout] Expected 'status=1\n', got 'status=0\n'

stdout:
status=0
stderr:
osh-cpp1 cd BAD/..

[osh-cpp stdout] Expected 'status=1\n', got 'status=0\n'

stdout:
status=0
stderr: