Commit 2f68d85
committed
refactor: improve whitespace validation and add comprehensive test coverage
Address feedback from @gemini-code-assist[bot] review:
1. Enhanced validation in parseStringArgs():
- Use strings.TrimSpace() to reject arguments consisting solely of whitespace
- Prevents creating nodes with whitespace-only paths
- Maintains preservation of intentional whitespace in valid arguments
2. Added comprehensive test cases for whitespace handling:
- Whitespace-only arguments (should be rejected)
- Multiple empty string arguments (should be rejected)
- Arguments with leading/trailing spaces (should be preserved)
- Mixed whitespace scenarios
This improves robustness while maintaining backward compatibility and
the core functionality of handling unquoted paths with spaces.
Signed-off-by: Ricardo Aravena <[email protected]>1 parent 0b05639 commit 2f68d85
2 files changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| |||
0 commit comments