1
0
Fork 0
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:
Jason Hall 2025-09-26 19:55:13 -04:00 committed by GitHub
parent 38bef8a370
commit 3a8e953f70
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 156 additions and 3 deletions

View file

@ -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