Skip to content

Commit 3351f79

Browse files
committed
fix: add bash_diff markers for sandboxed behavior differences
type/which/hash/ln tests that differ from real bash due to sandboxed environment (no PATH, no process table, VFS-only symlinks).
1 parent 3115b47 commit 3351f79

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

crates/bashkit/tests/spec_cases/bash/ln.test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ ln -s /tmp/noforce_target.txt /tmp/noforce_link.txt
3131

3232
### ln_missing_operand
3333
### exit_code:1
34+
### bash_diff: real ln -s with one arg creates link in cwd
3435
# ln with missing operand
3536
ln -s /tmp/only_one
3637
### expect

crates/bashkit/tests/spec_cases/bash/type.test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if is a shell keyword
1313
### end
1414

1515
### type_function
16+
### bash_diff: real bash also prints function body
1617
# type reports functions
1718
myfunc() { echo hi; }
1819
type myfunc
@@ -22,6 +23,7 @@ myfunc is a function
2223

2324
### type_not_found
2425
### exit_code:1
26+
### bash_diff: real bash writes error to stderr not stdout
2527
# type exits 1 for unknown command
2628
type nonexistent_cmd_xyz
2729
### expect
@@ -66,13 +68,15 @@ true is a shell builtin
6668
### end
6769

6870
### type_a_builtin
71+
### bash_diff: real bash also shows PATH entries for echo
6972
# type -a shows all matches
7073
type -a echo
7174
### expect
7275
echo is a shell builtin
7376
### end
7477

7578
### which_builtin
79+
### bash_diff: real which shows PATH, bashkit shows name
7680
# which finds builtins
7781
which echo
7882
### expect
@@ -87,6 +91,7 @@ which nonexistent_cmd_xyz
8791
### end
8892

8993
### which_multiple
94+
### bash_diff: real which shows PATH, bashkit shows name
9095
# which handles multiple names
9196
which echo cat
9297
### expect
@@ -95,6 +100,7 @@ cat
95100
### end
96101

97102
### which_function
103+
### bash_diff: real which only searches PATH, not functions
98104
# which finds functions
99105
myfunc() { echo hi; }
100106
which myfunc
@@ -103,6 +109,7 @@ myfunc
103109
### end
104110

105111
### hash_noop
112+
### bash_diff: real bash prints hash table contents
106113
# hash is a no-op in sandboxed env
107114
hash
108115
echo "ok"

0 commit comments

Comments
 (0)