Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Fable build #196

Merged
merged 1 commit into from
Nov 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"fable": {
"version": "4.0.0-theta-015",
"version": "4.0.0-theta-018",
"commands": [
"fable"
]
Expand Down
20 changes: 10 additions & 10 deletions tests/FsToolkit.ErrorHandling.Tests/Expect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,36 @@ module Expect =


#if FABLE_COMPILER
let inline isOk x message =
let isOk x message =
match x with
| Ok _ -> ()
| Result.Error x -> Tests.failtestf "%s. Expected Ok, was Error(%A)." message x
#endif

let inline hasErrorValue v x =
let hasErrorValue v x =
match x with
| Ok x -> Tests.failtestf "Expected Error, was Ok(%A)." x
| Error x when x = v -> ()
| Error x -> Tests.failtestf "Expected Error(%A), was Error(%A)." v x

let inline hasOkValue v x =
let hasOkValue v x =
match x with
| Ok x when x = v -> ()
| Ok x -> Tests.failtestf "Expected Ok(%A), was Ok(%A)." v x
| Error x -> Tests.failtestf "Expected Ok, was Error(%A)." x

let inline hasSomeValue v x =
let hasSomeValue v x =
match x with
| Some x when x = v -> ()
| Some x -> Tests.failtestf "Expected Some(%A), was Some(%A)." v x
| None -> Tests.failtestf "Expected Some, was None."

let inline hasNoneValue x =
let hasNoneValue x =
match x with
| None -> ()
| Some _ -> Tests.failtestf "Expected None, was Some."

let inline hasAsyncValue v asyncX = async {
let hasAsyncValue v asyncX = async {
let! x = asyncX

if v = x then
Expand All @@ -58,22 +58,22 @@ module Expect =
Tests.failtestf "Expected %A, was %A." v x
}

let inline hasAsyncOkValue v asyncX = async {
let hasAsyncOkValue v asyncX = async {
let! x = asyncX
hasOkValue v x
}

let inline hasAsyncErrorValue v asyncX = async {
let hasAsyncErrorValue v asyncX = async {
let! x = asyncX
hasErrorValue v x
}

let inline hasAsyncSomeValue v asyncX = async {
let hasAsyncSomeValue v asyncX = async {
let! x = asyncX
hasSomeValue v x
}

let inline hasAsyncNoneValue asyncX = async {
let hasAsyncNoneValue asyncX = async {
let! x = asyncX
hasNoneValue x
}
Expand Down