Skip to content

Implement test/[ builtin with file, string, integer, and logic operators#16

Closed
AlexandreYang wants to merge 9 commits intomainfrom
alex/builtin_test
Closed

Implement test/[ builtin with file, string, integer, and logic operators#16
AlexandreYang wants to merge 9 commits intomainfrom
alex/builtin_test

Conversation

@AlexandreYang
Copy link
Copy Markdown
Member

Summary

  • Adds test and [ builtins supporting file tests (-e, -f, -d, -s, -L), string tests (-z, -n, =, !=), integer comparisons (-eq, -ne, -lt, -le, -gt, -ge), and logic operators (!, -a, -o, parentheses)
  • Includes comprehensive unit tests and 30 YAML scenario tests covering all operators, edge cases, and error handling
  • Updates SHELL_COMMANDS.md and SHELL_FEATURES.md documentation

Test plan

  • Unit tests pass: go test ./interp/builtins/tests/test/...
  • Scenario tests pass: go test ./tests/ -run TestShellScenarios
  • Bash comparison tests pass: RSHELL_BASH_TEST=1 go test ./tests/ -run TestShellScenariosAgainstBash -timeout 120s

🤖 Generated with Claude Code

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce23d6fcb3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread interp/builtins/test/test.go
Comment thread interp/builtins/test/test.go Outdated
Comment thread interp/builtins/test/test.go Outdated
AlexandreYang and others added 2 commits March 9, 2026 23:41
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AlexandreYang and others added 7 commits March 9, 2026 23:59
…s to scenarios

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…est scenarios

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment on lines +42 to +49
"os.FileInfo",
"os.ModeSymlink",
"os.O_RDONLY",
"os.SameFile",
"path/filepath.Ext",
"strconv.Atoi",
"strconv.ParseInt",
"strings.ToLower",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be wrapped with os.Root?

@matt-dz matt-dz mentioned this pull request Mar 12, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant