Pentole/tests/result_tests.fs

17 lines
352 B
Forth
Raw Permalink Normal View History

2024-12-07 12:17:48 +01:00
module Tests.Result
open NUnit.Framework
2024-12-12 11:37:59 +01:00
open Pentole.Assert
2024-12-07 12:17:48 +01:00
open Pentole
[<Test>]
let err_test () =
let got = ResultList.collect (Result.protect int) ["123"; "abc"; "456"]
let msg = "The input string 'abc' was not in a correct format."
match got with
| Ok _ -> Assert.Fail "Expected an error"
2024-12-12 10:37:42 +01:00
| Error exn -> areEqual exn.Message msg