File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Core Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -33,19 +33,18 @@ type ResultTests() =
3333 let actual = validate_ email email
3434 Assert.AreEqual( expected, actual)
3535
36+ let toUpper ( v : string ) = v.ToUpper()
37+
38+ let shouldBeOkWithValue expected maybeOk = match maybeOk with | Error e-> failwith " Expected Ok, got Error!" | Ok v-> Assert.AreEqual( expected, v)
39+
40+ let shouldBeErrorWithValue expected maybeError = match maybeError with | Error e-> Assert.AreEqual( expected, e) | Ok v-> failwith " Expected Error, got Ok!"
3641
3742 [<Test>]
3843 member this.CanChainTogetherSuccessiveValidations () =
3944 test_ validate_ email " " ( Error Empty)
4045 test_ validate_ email " something_else" ( Error NoAt)
4146 test_ validate_ email " some@email.com" ( Ok " some@email.com" )
4247
43- let toUpper ( v : string ) = v.ToUpper()
44-
45- let shouldBeOkWithValue expected maybeOk = match maybeOk with | Error e-> failwith " Expected Ok, got Error!" | Ok v-> Assert.AreEqual( expected, v)
46-
47- let shouldBeErrorWithValue expected maybeError = match maybeError with | Error e-> Assert.AreEqual( expected, e) | Ok v-> failwith " Expected Error, got Ok!"
48-
4948 [<Test>]
5049 member this.MapWillTransformOkValues () =
5150 Ok " some@email.com"
You can’t perform that action at this time.
0 commit comments