mirror of
https://github.com/imjasonh/testscript-rs
synced 2026-07-18 06:37:31 +00:00
improve error messages with context (#13)
Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
parent
38bef8a370
commit
3a8e953f70
5 changed files with 156 additions and 3 deletions
14
README.md
14
README.md
|
|
@ -139,6 +139,20 @@ Test scripts use the [`txtar`](https://pkg.go.dev/github.com/rogpeppe/go-interna
|
|||
|
||||
Commands can be prefixed with conditions (`[unix]`) or negated (`!`).
|
||||
|
||||
## Error Messages
|
||||
|
||||
testscript-rs provides detailed error messages with script context to make debugging easy:
|
||||
|
||||
```
|
||||
Error in testdata/hello.txt at line 6:
|
||||
3 | stdout "this works"
|
||||
4 |
|
||||
5 | # This command will fail
|
||||
> 6 | exec nonexistent-command arg1 arg2
|
||||
7 | stdout "should not get here"
|
||||
8 |
|
||||
```
|
||||
|
||||
> Note: Some features of `testscript` in Go are not supported in this Rust port:
|
||||
>
|
||||
> - `[gc]` for whether Go was built with gc
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue