1
0
Fork 0
mirror of https://github.com/imjasonh/testscript-rs synced 2026-07-08 00:55:52 +00:00

Remove TestWork debugging section from README

Removed the section on preserving the working directory for debugging failed tests.
This commit is contained in:
Jason Hall 2025-09-27 14:52:51 -04:00 committed by GitHub
parent 10ef6aea68
commit 13e4ac033b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -201,32 +201,3 @@ stdout "my-tool 2.1.0"
```
This feature only updates `stdout` and `stderr` expectations while preserving file structure and comments.
## TestWork (Debug Failed Tests)
When tests fail, you can preserve the working directory to inspect the test environment and debug issues:
```rust
testscript::run("testdata")
.preserve_work_on_failure(true)
.execute()
.unwrap();
```
When a test fails with this option enabled, you'll see output like:
```
Test failed. Work directory preserved at: /tmp/testscript-work-abc123
You can inspect the test environment:
cd /tmp/testscript-work-abc123
ls -la
```
This feature matches Go's testscript `TestWork` functionality and makes debugging much easier by allowing you to:
- Inspect files created during test execution
- Manually run commands that failed
- Understand the exact state when the test failed
- Debug complex test scenarios step-by-step
The working directory contains all files from the test script's file blocks, plus any files created during test execution.