Commit c9a8cad
fix: address 10 code TODOs across codebase (#215)
## Summary
Addresses 10 TODO/skipped-test items across the codebase, reducing
skipped spec tests from 87 to 76 (11 unskipped) and resolving all
explicit TODO comments in source code.
### Changes by commit:
1. **feat(wc): add -m, -L, --bytes/--lines/--words/--chars flags** —
Full wc improvement: character count (-m/--chars), max line length (-L),
and long flag aliases. Unskips 5 spec tests.
2. **fix(tests): unskip herestring_empty test** — The empty herestring
correctly produces a newline (bash behavior). Rewrote test to verify via
follow-up echo since the spec runner can't represent a bare newline as
expected output.
3. **feat(interpreter): implement arithmetic assignment in $(())** —
Support `VAR = expr` inside arithmetic expansion (e.g. `$((X = X +
1))`). Correctly distinguishes from `==`/`!=`/`<=`/`>=`. Unskips
arith_assign.
4. **fix(interpreter): propagate exit code from command substitution** —
`x=$(false); echo $?` now correctly prints 1. Sets last_exit_code during
substitution and preserves it through assignment-only commands.
5. **feat(sort): add -f flag for case-insensitive sorting** — Implements
fold-case comparison via `sort_by_key`. Unskips sort_case_insensitive.
6. **fix(tests): unskip uniq -d/-u spec tests** — These flags were
already implemented in code with passing unit tests but had stale skip
markers in spec tests.
7. **chore(interpreter): resolve background execution and shell options
TODOs** — Replace TODO comments with proper documentation explaining
design decisions (background runs synchronously in sandbox; shell
options accepted but not enforced).
8. **chore(deny): replace license clarification TODO** — Remove unused
template placeholder with explanatory comment.
## Test plan
- [x] `cargo fmt --check` passes
- [x] `cargo clippy --all-targets --all-features -- -D warnings` passes
- [x] `cargo test --all-features` — all 977+ tests pass, 0 failures
- [x] All 11 previously-skipped spec tests now pass
- [x] No regressions in existing tests
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent ace5d14 commit c9a8cad
File tree
10 files changed
+274
-106
lines changed- crates/bashkit
- src
- builtins
- interpreter
- tests
- spec_cases/bash
10 files changed
+274
-106
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
| |||
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| 96 | + | |
| 97 | + | |
91 | 98 | | |
92 | 99 | | |
93 | 100 | | |
| |||
309 | 316 | | |
310 | 317 | | |
311 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
312 | 326 | | |
313 | 327 | | |
314 | 328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | | - | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
21 | 83 | | |
22 | 84 | | |
23 | 85 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 86 | + | |
34 | 87 | | |
35 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
36 | 93 | | |
37 | 94 | | |
38 | 95 | | |
39 | 96 | | |
40 | 97 | | |
| 98 | + | |
| 99 | + | |
41 | 100 | | |
42 | 101 | | |
43 | 102 | | |
44 | 103 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 104 | + | |
| 105 | + | |
49 | 106 | | |
50 | 107 | | |
51 | 108 | | |
| |||
60 | 117 | | |
61 | 118 | | |
62 | 119 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
78 | 131 | | |
79 | 132 | | |
80 | 133 | | |
| |||
85 | 138 | | |
86 | 139 | | |
87 | 140 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
97 | 149 | | |
98 | 150 | | |
99 | 151 | | |
| |||
102 | 154 | | |
103 | 155 | | |
104 | 156 | | |
105 | | - | |
106 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
107 | 167 | | |
108 | 168 | | |
109 | 169 | | |
110 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
111 | 179 | | |
112 | 180 | | |
113 | 181 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 182 | + | |
123 | 183 | | |
124 | 184 | | |
125 | | - | |
126 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
127 | 193 | | |
128 | | - | |
129 | | - | |
| 194 | + | |
| 195 | + | |
130 | 196 | | |
131 | | - | |
132 | | - | |
| 197 | + | |
| 198 | + | |
133 | 199 | | |
134 | 200 | | |
135 | 201 | | |
| |||
209 | 275 | | |
210 | 276 | | |
211 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
212 | 315 | | |
0 commit comments