Commit 92f2cc0
authored
* feat: add CLI robustness test suite
Add comprehensive automated test suite for milk-cli:
- tests/cli/cli_robustness_tests.milk: 109 annotated test
cases covering basic parsing, help/discovery, builtins,
missing/wrong arguments, variables, arithmetic, flow
control, user functions, command chaining, shell features
(pipes, redirects, here-strings, command substitution),
error conditions, set flags, readonly/declare.
- tests/cli/run_cli_robustness_tests.sh: Bash test runner
that feeds tests one-by-one to milk-cli, captures output,
checks for crashes/hangs/missing error messages, and
prints a summary report.
- .agents/workflows/cli-robustness-test.md: Workflow for
running the test suite.
Initial run: 105 pass, 4 MISSING_ERROR (no error message
printed for: cmd? with unknown command, cd to nonexistent
directory, mem.mk2Dim with no args, mem.rm with no args).
* fix: CLI error reporting for cmd? and cd with absolute paths
Fix two CLI error reporting bugs found by the robustness test suite:
1. help_command() (cmd?) now returns RETURN_FAILURE when the queried
command is not found. Previously it always returned RETURN_SUCCESS
even when printing "does not exist", misleading the caller.
2. Extend tokenizer raw-string bypass to treat arguments starting
with '/' as raw strings (same as '-' prefixed arguments). This
fixes cd /absolute/path where the '/' was misinterpreted as
division by cli_parse(), causing a silent parse error that
skipped command execution entirely.
Update test expectations: mem.mk2Dim and mem.rm with no arguments
correctly create a local FPS with defaults — this is expected
FPS behavior, not an error. Also add 'does not exist' to the
runner grep pattern for error detection.
1 parent 5959de7 commit 92f2cc0
5 files changed
Lines changed: 1000 additions & 8 deletions
File tree
- .agents/workflows
- src/cli/CLIcore/CLIcore
- tests/cli
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2944 | 2944 | | |
2945 | 2945 | | |
2946 | 2946 | | |
2947 | | - | |
2948 | | - | |
2949 | | - | |
2950 | | - | |
2951 | | - | |
2952 | | - | |
| 2947 | + | |
| 2948 | + | |
| 2949 | + | |
| 2950 | + | |
| 2951 | + | |
| 2952 | + | |
| 2953 | + | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
2953 | 2957 | | |
2954 | 2958 | | |
2955 | 2959 | | |
2956 | | - | |
| 2960 | + | |
| 2961 | + | |
2957 | 2962 | | |
2958 | 2963 | | |
2959 | 2964 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1100 | 1100 | | |
1101 | 1101 | | |
1102 | 1102 | | |
1103 | | - | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
1104 | 1107 | | |
1105 | 1108 | | |
| 1109 | + | |
1106 | 1110 | | |
1107 | 1111 | | |
1108 | 1112 | | |
| |||
0 commit comments