Add syntax for exceptions (#19)

This commit is contained in:
Patrick Stevens
2025-07-06 22:30:02 +01:00
committed by GitHub
parent 75899d5668
commit ca74c4816b
8 changed files with 104 additions and 11 deletions

View File

@@ -44,6 +44,13 @@ let ``This test fails: plain text comparison of ToString`` () =
snapshot " 123 "
return 123
}
[<Test>]
let ``With return! and snapshotThrows, you can see exceptions too`` () =
expect {
snapshotThrows @"System.Exception: oh no"
return! (fun () -> failwith<int> "oh no")
}
```
You can adjust the formatting: