-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirections Extension #75
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… and response validation
This commit introduces a new `MultiLineAssertion` type in `multi_line_assertion.go`, which allows for asserting that multiple lines of output match against an array of expected strings or regex patterns. The implementation includes methods for inspecting the assertion and running the validation against the screen state, enhancing the testing capabilities for multi-line outputs.
This commit introduces a new `FileContentAssertion` type in `file_content_assertion.go`, which allows for verifying that a specified file contains the expected content. The implementation includes methods for inspecting the assertion and executing the validation, enhancing the testing capabilities for file content checks.
… response validation
When the outputFilePath collides with another same path outputs will no longer match cleanly
This commit introduces the `stage_r3` test, which validates shell behavior for redirected file content and directory listing handling via `ls` and `cat` commands. It sets up required random directories, files, and test cases, ensuring proper assertions and cleanup. The implementation is foundational for future expansion of test scenarios. Signed-off-by: Ryan Gang <[email protected]>
…ling This commit updates the `stage_r3` test to include additional command reflection and response validation for multi-line outputs. It introduces new commands to echo content into files and validates the output using the `CommandWithMultilineResponseTestCase`. The changes improve the robustness of the test by ensuring that multiple lines of output are correctly captured and asserted, enhancing overall test coverage for shell command handling.
…lti-line response validation
This commit introduces a new function, `getShortRandomDirectories`, in `internal/utils.go` that generates a specified number of random directory paths and creates them in the `/tmp` directory. The function utilizes elements from the `SMALL_WORDS` array to form directory names and handles errors during directory creation, improving the utility of the codebase for generating temporary directories.
This commit refactors the directory cleanup process in the `stage_r1`, `stage_r2`, `stage_r3`, and `stage_r4` test files by introducing a new `cleanupDirectories` function. This change replaces the individual `defer os.RemoveAll(dir)` calls with a single deferred call to `cleanupDirectories(dirs)`, improving code readability and maintainability across the test implementations.
This commit refactors the `stage_r1` test by consolidating command definitions and improving variable assignments for clarity. The changes include replacing multiple `strings.Join` calls with direct variable assignments for random words, and updating command strings to reflect the new output file paths. This enhances code readability and maintains consistency in command execution across the test cases.
This commit refactors the `testR1` function in `stage_r1.go` by streamlining the creation and execution of command test cases. The changes include consolidating variable assignments for command reflection and response test cases, improving readability and reducing redundancy. This enhances the clarity of the test logic while maintaining the functionality of command execution and output validation.
This commit refactors the `testR2` function by consolidating variable assignments and improving command test case structure. Key changes include replacing multiple `strings.Join` calls with direct assignments for random words, updating the method for generating random words, and enhancing the clarity of command definitions. These improvements enhance code readability and maintain the functionality of command execution and output validation.
… and enhancing random word generation This commit refactors the `testR3` function in `stage_r3.go` by consolidating variable assignments and improving the structure of command test cases. Key changes include replacing multiple variable declarations with tuple assignment for clarity, updating the method for generating random words to use `RandomElementsFromArray`, and streamlining command definitions. These enhancements improve code readability and maintain the functionality of command execution and output validation.
… and improving random word generation This commit refactors the `testR4` function in `stage_r4.go` by consolidating variable assignments and enhancing the structure of command test cases. Key changes include using tuple assignment for `stageDir` and `lsDir`, updating the random word generation method to `RandomElementsFromArray`, and streamlining command definitions. These improvements enhance code readability while maintaining the functionality of command execution and output validation.
This commit refactors the `testR2` function in `stage_r2.go` by updating the way error messages are constructed and handled. Key changes include modifying the message formatting to ensure proper encapsulation of the file name in quotes, and adjusting the expected output to reflect this change. These improvements enhance code clarity and maintain the functionality of command execution and output validation.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.