mirror of
https://github.com/Smaug123/WoofWare.Expect
synced 2025-10-06 04:58:39 +00:00
Add ability to update snapshots (#4)
This commit is contained in:
@@ -5,8 +5,9 @@ An [expect-testing](https://blog.janestreet.com/the-joy-of-expect-tests/) librar
|
||||
|
||||
# Current status
|
||||
|
||||
Basic mechanism works, but I haven't yet decided how the ergonomic updating of the input text will work.
|
||||
Ideally it would edit the input AST, but I don't yet know if that's viable.
|
||||
The basic mechanism works.
|
||||
Snapshot updating is vibe-coded with Opus 4 and is purely text-based; I didn't want to use the F# compiler services because that's a pretty heavyweight dependency which should be confined to a separate test runner entity.
|
||||
It's not very well tested, and I expect it to be kind of brittle.
|
||||
|
||||
# How to use
|
||||
|
||||
@@ -35,6 +36,10 @@ let ``This test fails: plain text comparison of ToString`` () =
|
||||
}
|
||||
```
|
||||
|
||||
# Limitations
|
||||
|
||||
* The snapshot updating mechanism *requires* you to use verbatim string literals. While the test assertions will work correctly if you do `snapshot ("foo" + "bar" + f 3)`, for example, the updating code is liable to do something undefined in that case. Also do not use format strings (`$"blah"`).
|
||||
|
||||
# Licence
|
||||
|
||||
MIT.
|
||||
|
Reference in New Issue
Block a user