aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gen/bool.erl14
-rw-r--r--gen/list.erl34
-rw-r--r--gen/map.erl20
-rw-r--r--gen/order.erl56
-rw-r--r--gen/result.erl20
-rw-r--r--src/bool.gleam16
-rw-r--r--src/list.gleam40
-rw-r--r--src/map.gleam12
-rw-r--r--src/order.gleam56
-rw-r--r--src/result.gleam20
10 files changed, 141 insertions, 147 deletions
diff --git a/gen/bool.erl b/gen/bool.erl
index 8b9c1c4..01c81ce 100644
--- a/gen/bool.erl
+++ b/gen/bool.erl
@@ -15,9 +15,9 @@ max(A, B) ->
-ifdef(TEST).
max_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, true) end)(max(true, true)),
- _ = (fun(Capture1) -> expect:equal(Capture1, true) end)(max(true, false)),
- _ = (fun(Capture1) -> expect:equal(Capture1, false) end)(max(false, false)),
+ (fun(Capture1) -> expect:equal(Capture1, true) end)(max(true, true)),
+ (fun(Capture1) -> expect:equal(Capture1, true) end)(max(true, false)),
+ (fun(Capture1) -> expect:equal(Capture1, false) end)(max(false, false)),
(fun(Capture1) -> expect:equal(Capture1, true) end)(max(false, true)).
-endif.
@@ -32,9 +32,9 @@ min(A, B) ->
-ifdef(TEST).
min_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, true) end)(min(true, true)),
- _ = (fun(Capture1) -> expect:equal(Capture1, false) end)(min(true, false)),
- _ = (fun(Capture1) -> expect:equal(Capture1, false) end)(min(false, false)),
+ (fun(Capture1) -> expect:equal(Capture1, true) end)(min(true, true)),
+ (fun(Capture1) -> expect:equal(Capture1, false) end)(min(true, false)),
+ (fun(Capture1) -> expect:equal(Capture1, false) end)(min(false, false)),
(fun(Capture1) -> expect:equal(Capture1, false) end)(min(false, true)).
-endif.
@@ -49,6 +49,6 @@ to_int(Bool) ->
-ifdef(TEST).
to_int_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, 1) end)(to_int(true)),
+ (fun(Capture1) -> expect:equal(Capture1, 1) end)(to_int(true)),
(fun(Capture1) -> expect:equal(Capture1, 0) end)(to_int(false)).
-endif.
diff --git a/gen/list.erl b/gen/list.erl
index 7364f66..3155824 100644
--- a/gen/list.erl
+++ b/gen/list.erl
@@ -9,9 +9,9 @@ length(A) ->
-ifdef(TEST).
length_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, 0) end)(length([])),
- _ = (fun(Capture1) -> expect:equal(Capture1, 1) end)(length([1])),
- _ = (fun(Capture1) -> expect:equal(Capture1, 2) end)(length([1, 1])),
+ (fun(Capture1) -> expect:equal(Capture1, 0) end)(length([])),
+ (fun(Capture1) -> expect:equal(Capture1, 1) end)(length([1])),
+ (fun(Capture1) -> expect:equal(Capture1, 2) end)(length([1, 1])),
(fun(Capture1) -> expect:equal(Capture1, 3) end)(length([1, 1, 1])).
-endif.
@@ -20,7 +20,7 @@ reverse(A) ->
-ifdef(TEST).
reverse_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, 0) end)(length([])),
+ (fun(Capture1) -> expect:equal(Capture1, 0) end)(length([])),
(fun(Capture1) -> expect:equal(Capture1, 5) end)(length([1, 2, 3, 4, 5])).
-endif.
@@ -29,7 +29,7 @@ is_empty(List) ->
-ifdef(TEST).
is_empty_test() ->
- _ = expect:true(is_empty([])),
+ expect:true(is_empty([])),
expect:false(is_empty([1])).
-endif.
@@ -44,8 +44,8 @@ has_member(List, Elem) ->
-ifdef(TEST).
has_member_test() ->
- _ = expect:true(has_member([0, 4, 5, 1], 1)),
- _ = expect:false(has_member([0, 4, 5, 7], 1)),
+ expect:true(has_member([0, 4, 5, 1], 1)),
+ expect:false(has_member([0, 4, 5, 7], 1)),
expect:false(has_member([], 1)).
-endif.
@@ -60,9 +60,7 @@ head(List) ->
-ifdef(TEST).
head_test() ->
- _ = (fun(Capture1) ->
- expect:equal(Capture1, {ok, 0})
- end)(head([0, 4, 5, 7])),
+ (fun(Capture1) -> expect:equal(Capture1, {ok, 0}) end)(head([0, 4, 5, 7])),
(fun(Capture1) -> expect:equal(Capture1, {error, empty}) end)(head([])).
-endif.
@@ -77,10 +75,10 @@ tail(List) ->
-ifdef(TEST).
tail_test() ->
- _ = (fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, {ok, [4, 5, 7]})
end)(tail([0, 4, 5, 7])),
- _ = (fun(Capture1) -> expect:equal(Capture1, {ok, []}) end)(tail([0])),
+ (fun(Capture1) -> expect:equal(Capture1, {ok, []}) end)(tail([0])),
(fun(Capture1) -> expect:equal(Capture1, {error, empty}) end)(tail([])).
-endif.
@@ -98,7 +96,7 @@ map(List, Fun) ->
-ifdef(TEST).
map_test() ->
- _ = (fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, [])
end)((fun(Capture1) -> map(Capture1, fun(X) -> X * 2 end) end)([])),
(fun(Capture1) ->
@@ -135,7 +133,7 @@ traverse_test() ->
false ->
{error, X}
end end,
- _ = (fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, {ok, [10, 12, 10, 12]})
end)((fun(Capture1) -> traverse(Capture1, Fun) end)([5, 6, 5, 6])),
(fun(Capture1) ->
@@ -173,11 +171,9 @@ flatten(Lists) ->
-ifdef(TEST).
flatten_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, []) end)(flatten([])),
- _ = (fun(Capture1) -> expect:equal(Capture1, []) end)(flatten([[]])),
- _ = (fun(Capture1) ->
- expect:equal(Capture1, [])
- end)(flatten([[], [], []])),
+ (fun(Capture1) -> expect:equal(Capture1, []) end)(flatten([])),
+ (fun(Capture1) -> expect:equal(Capture1, []) end)(flatten([[]])),
+ (fun(Capture1) -> expect:equal(Capture1, []) end)(flatten([[], [], []])),
(fun(Capture1) ->
expect:equal(Capture1, [1, 2, 3, 4])
end)(flatten([[1, 2], [], [3, 4]])).
diff --git a/gen/map.erl b/gen/map.erl
index c2a07d4..7a4bafa 100644
--- a/gen/map.erl
+++ b/gen/map.erl
@@ -28,15 +28,13 @@ has_key(Map, Key) ->
-ifdef(TEST).
has_key_test() ->
- _ = expect:false((fun(Capture1) ->
- has_key(Capture1, 1)
- end)(from_list([]))),
- _ = expect:true((fun(Capture1) ->
- has_key(Capture1, 1)
- end)(from_list([{1, 0}]))),
- _ = expect:true((fun(Capture1) ->
- has_key(Capture1, 1)
- end)(from_list([{4, 0}, {1, 0}]))),
+ expect:false((fun(Capture1) -> has_key(Capture1, 1) end)(from_list([]))),
+ expect:true((fun(Capture1) ->
+ has_key(Capture1, 1)
+ end)(from_list([{1, 0}]))),
+ expect:true((fun(Capture1) ->
+ has_key(Capture1, 1)
+ end)(from_list([{4, 0}, {1, 0}]))),
expect:false((fun(Capture1) ->
has_key(Capture1, 0)
end)(from_list([{4, 0}, {1, 0}]))).
@@ -47,7 +45,7 @@ new() ->
-ifdef(TEST).
new_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, 0) end)(size(new())),
+ (fun(Capture1) -> expect:equal(Capture1, 0) end)(size(new())),
(fun(Capture1) -> expect:equal(Capture1, []) end)(to_list(new())).
-endif.
@@ -58,7 +56,7 @@ fetch(A, B) ->
fetch_test() ->
Proplist = [{4, 0}, {1, 1}],
Map = from_list(Proplist),
- _ = (fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, {ok, 0})
end)((fun(Capture1) -> fetch(Capture1, 4) end)(Map)),
(fun(Capture1) ->
diff --git a/gen/order.erl b/gen/order.erl
index 69f0eb8..e970ee7 100644
--- a/gen/order.erl
+++ b/gen/order.erl
@@ -18,8 +18,8 @@ reverse(Order) ->
-ifdef(TEST).
reverse_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, gt) end)(reverse(lt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, eq) end)(reverse(eq)),
+ (fun(Capture1) -> expect:equal(Capture1, gt) end)(reverse(lt)),
+ (fun(Capture1) -> expect:equal(Capture1, eq) end)(reverse(eq)),
(fun(Capture1) -> expect:equal(Capture1, lt) end)(reverse(gt)).
-endif.
@@ -37,8 +37,8 @@ to_int(Order) ->
-ifdef(TEST).
to_int_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, -1) end)(to_int(lt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, 0) end)(to_int(eq)),
+ (fun(Capture1) -> expect:equal(Capture1, -1) end)(to_int(lt)),
+ (fun(Capture1) -> expect:equal(Capture1, 0) end)(to_int(eq)),
(fun(Capture1) -> expect:equal(Capture1, 1) end)(to_int(gt)).
-endif.
@@ -65,14 +65,14 @@ compare(A, B) ->
-ifdef(TEST).
compare_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, eq) end)(compare(lt, lt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, lt) end)(compare(lt, eq)),
- _ = (fun(Capture1) -> expect:equal(Capture1, lt) end)(compare(lt, gt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, gt) end)(compare(eq, lt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, eq) end)(compare(eq, eq)),
- _ = (fun(Capture1) -> expect:equal(Capture1, lt) end)(compare(eq, gt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, gt) end)(compare(gt, lt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, gt) end)(compare(gt, eq)),
+ (fun(Capture1) -> expect:equal(Capture1, eq) end)(compare(lt, lt)),
+ (fun(Capture1) -> expect:equal(Capture1, lt) end)(compare(lt, eq)),
+ (fun(Capture1) -> expect:equal(Capture1, lt) end)(compare(lt, gt)),
+ (fun(Capture1) -> expect:equal(Capture1, gt) end)(compare(eq, lt)),
+ (fun(Capture1) -> expect:equal(Capture1, eq) end)(compare(eq, eq)),
+ (fun(Capture1) -> expect:equal(Capture1, lt) end)(compare(eq, gt)),
+ (fun(Capture1) -> expect:equal(Capture1, gt) end)(compare(gt, lt)),
+ (fun(Capture1) -> expect:equal(Capture1, gt) end)(compare(gt, eq)),
(fun(Capture1) -> expect:equal(Capture1, eq) end)(compare(gt, gt)).
-endif.
@@ -90,14 +90,14 @@ max(A, B) ->
-ifdef(TEST).
max_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, lt) end)(max(lt, lt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, eq) end)(max(lt, eq)),
- _ = (fun(Capture1) -> expect:equal(Capture1, gt) end)(max(lt, gt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, eq) end)(max(eq, lt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, eq) end)(max(eq, eq)),
- _ = (fun(Capture1) -> expect:equal(Capture1, gt) end)(max(eq, gt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, gt) end)(max(gt, lt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, gt) end)(max(gt, eq)),
+ (fun(Capture1) -> expect:equal(Capture1, lt) end)(max(lt, lt)),
+ (fun(Capture1) -> expect:equal(Capture1, eq) end)(max(lt, eq)),
+ (fun(Capture1) -> expect:equal(Capture1, gt) end)(max(lt, gt)),
+ (fun(Capture1) -> expect:equal(Capture1, eq) end)(max(eq, lt)),
+ (fun(Capture1) -> expect:equal(Capture1, eq) end)(max(eq, eq)),
+ (fun(Capture1) -> expect:equal(Capture1, gt) end)(max(eq, gt)),
+ (fun(Capture1) -> expect:equal(Capture1, gt) end)(max(gt, lt)),
+ (fun(Capture1) -> expect:equal(Capture1, gt) end)(max(gt, eq)),
(fun(Capture1) -> expect:equal(Capture1, gt) end)(max(gt, gt)).
-endif.
@@ -115,13 +115,13 @@ min(A, B) ->
-ifdef(TEST).
min_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, lt) end)(min(lt, lt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, lt) end)(min(lt, eq)),
- _ = (fun(Capture1) -> expect:equal(Capture1, lt) end)(min(lt, gt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, lt) end)(min(eq, lt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, eq) end)(min(eq, eq)),
- _ = (fun(Capture1) -> expect:equal(Capture1, eq) end)(min(eq, gt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, lt) end)(min(gt, lt)),
- _ = (fun(Capture1) -> expect:equal(Capture1, eq) end)(min(gt, eq)),
+ (fun(Capture1) -> expect:equal(Capture1, lt) end)(min(lt, lt)),
+ (fun(Capture1) -> expect:equal(Capture1, lt) end)(min(lt, eq)),
+ (fun(Capture1) -> expect:equal(Capture1, lt) end)(min(lt, gt)),
+ (fun(Capture1) -> expect:equal(Capture1, lt) end)(min(eq, lt)),
+ (fun(Capture1) -> expect:equal(Capture1, eq) end)(min(eq, eq)),
+ (fun(Capture1) -> expect:equal(Capture1, eq) end)(min(eq, gt)),
+ (fun(Capture1) -> expect:equal(Capture1, lt) end)(min(gt, lt)),
+ (fun(Capture1) -> expect:equal(Capture1, eq) end)(min(gt, eq)),
(fun(Capture1) -> expect:equal(Capture1, gt) end)(min(gt, gt)).
-endif.
diff --git a/gen/result.erl b/gen/result.erl
index 101b56a..266b41f 100644
--- a/gen/result.erl
+++ b/gen/result.erl
@@ -15,7 +15,7 @@ is_ok(Result) ->
-ifdef(TEST).
is_ok_test() ->
- _ = expect:true(is_ok({ok, 1})),
+ expect:true(is_ok({ok, 1})),
expect:false(is_ok({error, 1})).
-endif.
@@ -30,7 +30,7 @@ is_error(Result) ->
-ifdef(TEST).
is_error_test() ->
- _ = expect:false(is_error({ok, 1})),
+ expect:false(is_error({ok, 1})),
expect:true(is_error({error, 1})).
-endif.
@@ -45,7 +45,7 @@ map(Result, Fun) ->
-ifdef(TEST).
map_test() ->
- _ = (fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, {ok, 2})
end)((fun(Capture1) -> map(Capture1, fun(X) -> X + 1 end) end)({ok, 1})),
(fun(Capture1) ->
@@ -64,7 +64,7 @@ map_error(Result, Fun) ->
-ifdef(TEST).
map_error_test() ->
- _ = (fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, {ok, 1})
end)((fun(Capture1) ->
map_error(Capture1, fun(X) -> X + 1 end)
@@ -87,13 +87,13 @@ flatten(Result) ->
-ifdef(TEST).
flatten_test() ->
- _ = (fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, {ok, 1})
end)(flatten({ok, {ok, 1}})),
- _ = (fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, {error, 1})
end)(flatten({ok, {error, 1}})),
- _ = (fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, {error, 1})
end)(flatten({error, 1})),
(fun(Capture1) ->
@@ -118,12 +118,12 @@ flat_map(Result, Fun) ->
-ifdef(TEST).
flat_map_test() ->
- _ = (fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, {error, 1})
end)((fun(Capture1) ->
flat_map(Capture1, fun(X) -> {ok, X + 1} end)
end)({error, 1})),
- _ = (fun(Capture1) ->
+ (fun(Capture1) ->
expect:equal(Capture1, {ok, 2})
end)((fun(Capture1) ->
flat_map(Capture1, fun(X) -> {ok, X + 1} end)
@@ -146,7 +146,7 @@ unwrap(Result, Default) ->
-ifdef(TEST).
unwrap_test() ->
- _ = (fun(Capture1) -> expect:equal(Capture1, 1) end)(unwrap({ok, 1}, 50)),
+ (fun(Capture1) -> expect:equal(Capture1, 1) end)(unwrap({ok, 1}, 50)),
(fun(Capture1) ->
expect:equal(Capture1, 50)
end)(unwrap({error, <<"nope">>}, 50)).
diff --git a/src/bool.gleam b/src/bool.gleam
index 5a89287..84e5f6c 100644
--- a/src/bool.gleam
+++ b/src/bool.gleam
@@ -9,7 +9,7 @@ import order
// }
// test not {
-// let _ = not(True)
+// not(True)
// |> expect:false
// not(False)
@@ -47,13 +47,13 @@ pub fn max(a, b) {
}
test max {
- let _ = max(True, True)
+ max(True, True)
|> expect:equal(_, True)
- let _ = max(True, False)
+ max(True, False)
|> expect:equal(_, True)
- let _ = max(False, False)
+ max(False, False)
|> expect:equal(_, False)
max(False, True)
@@ -68,13 +68,13 @@ pub fn min(a, b) {
}
test min {
- let _ = min(True, True)
+ min(True, True)
|> expect:equal(_, True)
- let _ = min(True, False)
+ min(True, False)
|> expect:equal(_, False)
- let _ = min(False, False)
+ min(False, False)
|> expect:equal(_, False)
min(False, True)
@@ -89,7 +89,7 @@ pub fn to_int(bool) {
}
test to_int {
- let _ = to_int(True)
+ to_int(True)
|> expect:equal(_, 1)
to_int(False)
diff --git a/src/list.gleam b/src/list.gleam
index f9fb3b6..3f79b52 100644
--- a/src/list.gleam
+++ b/src/list.gleam
@@ -8,9 +8,9 @@ pub enum Error =
pub external fn length(List(a)) -> Int = "erlang" "length"
test length {
- let _ = length([]) |> expect:equal(_, 0)
- let _ = length([1]) |> expect:equal(_, 1)
- let _ = length([1, 1]) |> expect:equal(_, 2)
+ length([]) |> expect:equal(_, 0)
+ length([1]) |> expect:equal(_, 1)
+ length([1, 1]) |> expect:equal(_, 2)
length([1, 1, 1]) |> expect:equal(_, 3)
}
@@ -19,7 +19,7 @@ test length {
pub external fn reverse(List(a)) -> List(a) = "lists" "reverse"
test reverse {
- let _ = length([]) |> expect:equal(_, 0)
+ length([]) |> expect:equal(_, 0)
length([1, 2, 3, 4, 5]) |> expect:equal(_, 5)
}
@@ -28,7 +28,7 @@ pub fn is_empty(list) {
}
test is_empty {
- let _ = is_empty([]) |> expect:true
+ is_empty([]) |> expect:true
is_empty([1]) |> expect:false
}
@@ -40,8 +40,8 @@ pub fn has_member(list, elem) {
}
test has_member {
- let _ = has_member([0, 4, 5, 1], 1) |> expect:true
- let _ = has_member([0, 4, 5, 7], 1) |> expect:false
+ has_member([0, 4, 5, 1], 1) |> expect:true
+ has_member([0, 4, 5, 7], 1) |> expect:false
has_member([], 1) |> expect:false
}
@@ -53,7 +53,7 @@ pub fn head(list) {
}
test head {
- let _ = head([0, 4, 5, 7])
+ head([0, 4, 5, 7])
|> expect:equal(_, Ok(0))
head([])
@@ -68,10 +68,10 @@ pub fn tail(list) {
}
test tail {
- let _ = tail([0, 4, 5, 7])
+ tail([0, 4, 5, 7])
|> expect:equal(_, Ok([4, 5, 7]))
- let _ = tail([0])
+ tail([0])
|> expect:equal(_, Ok([]))
tail([])
@@ -96,15 +96,15 @@ test tail {
// }
// test filter {
-// let _ = []
+// []
// |> filter(_, fn(x) { True })
// |> expect:equal(_, [])
-// let _ = [0, 4, 5, 7, 3]
+// [0, 4, 5, 7, 3]
// |> filter(_, fn(x) { True })
// |> expect:equal(_, [0, 4, 5, 7, 3])
-// let _ = [0, 4, 5, 7, 3]
+// [0, 4, 5, 7, 3]
// |> filter(_, fn(x) { x > 4 })
// |> expect:equal(_, [5, 7])
@@ -125,7 +125,7 @@ pub fn map(list, fun) {
}
test map {
- let _ = []
+ []
|> map(_, fn(x) { x * 2 })
|> expect:equal(_, [])
@@ -157,7 +157,7 @@ test traverse {
}
}
- let _ = [5, 6, 5, 6]
+ [5, 6, 5, 6]
|> traverse(_, fun)
|> expect:equal(_, Ok([10, 12, 10, 12]))
@@ -179,7 +179,7 @@ test traverse {
// }
// test drop {
-// let _ = []
+// []
// |> drop(_, 5)
// |> expect:equal(_, [])
@@ -204,7 +204,7 @@ test traverse {
// }
// test take {
-// let _ = []
+// []
// |> take(_, 5)
// |> expect:equal(_, [])
// [1, 2, 3, 4, 5, 6, 7, 8]
@@ -241,13 +241,13 @@ pub fn flatten(lists) {
}
test flatten {
- let _ = flatten([])
+ flatten([])
|> expect:equal(_, [])
- let _ = flatten([[]])
+ flatten([[]])
|> expect:equal(_, [])
- let _ = flatten([[], [], []])
+ flatten([[], [], []])
|> expect:equal(_, [])
flatten([[1, 2], [], [3, 4]])
diff --git a/src/map.gleam b/src/map.gleam
index d5a662d..a8f024f 100644
--- a/src/map.gleam
+++ b/src/map.gleam
@@ -34,19 +34,19 @@ pub fn has_key(map, key) {
}
test has_key {
- let _ = []
+ []
|> from_list
|> has_key(_, 1)
|> expect:false
- let _ = [
+ [
{1, 0},
]
|> from_list
|> has_key(_, 1)
|> expect:true
- let _ = [
+ [
{4, 0},
{1, 0},
]
@@ -67,7 +67,7 @@ pub external fn new() -> Map(key, value)
= "maps" "new"
test new {
- let _ = new()
+ new()
|> size
|> expect:equal(_, 0)
@@ -83,7 +83,7 @@ test new {
// test from_record {
// let map = from_record({ name = "Jane" })
-// let _ = map
+// map
// |> size
// |> expect:equal(_, 1)
@@ -101,7 +101,7 @@ test fetch {
]
let map = from_list(proplist)
- let _ = map
+ map
|> fetch(_, 4)
|> expect:equal(_, Ok(0))
diff --git a/src/order.gleam b/src/order.gleam
index aa6756c..9e69114 100644
--- a/src/order.gleam
+++ b/src/order.gleam
@@ -15,8 +15,8 @@ pub fn reverse(order) {
}
test reverse {
- let _ = reverse(Lt) |> expect:equal(_, Gt)
- let _ = reverse(Eq) |> expect:equal(_, Eq)
+ reverse(Lt) |> expect:equal(_, Gt)
+ reverse(Eq) |> expect:equal(_, Eq)
reverse(Gt) |> expect:equal(_, Lt)
}
@@ -29,8 +29,8 @@ pub fn to_int(order) {
}
test to_int {
- let _ = to_int(Lt) |> expect:equal(_, -1)
- let _ = to_int(Eq) |> expect:equal(_, 0)
+ to_int(Lt) |> expect:equal(_, -1)
+ to_int(Eq) |> expect:equal(_, 0)
to_int(Gt) |> expect:equal(_, 1)
}
@@ -46,14 +46,14 @@ pub fn compare(a, b) {
}
test compare {
- let _ = compare(Lt, Lt) |> expect:equal(_, Eq)
- let _ = compare(Lt, Eq) |> expect:equal(_, Lt)
- let _ = compare(Lt, Gt) |> expect:equal(_, Lt)
- let _ = compare(Eq, Lt) |> expect:equal(_, Gt)
- let _ = compare(Eq, Eq) |> expect:equal(_, Eq)
- let _ = compare(Eq, Gt) |> expect:equal(_, Lt)
- let _ = compare(Gt, Lt) |> expect:equal(_, Gt)
- let _ = compare(Gt, Eq) |> expect:equal(_, Gt)
+ compare(Lt, Lt) |> expect:equal(_, Eq)
+ compare(Lt, Eq) |> expect:equal(_, Lt)
+ compare(Lt, Gt) |> expect:equal(_, Lt)
+ compare(Eq, Lt) |> expect:equal(_, Gt)
+ compare(Eq, Eq) |> expect:equal(_, Eq)
+ compare(Eq, Gt) |> expect:equal(_, Lt)
+ compare(Gt, Lt) |> expect:equal(_, Gt)
+ compare(Gt, Eq) |> expect:equal(_, Gt)
compare(Gt, Gt) |> expect:equal(_, Eq)
}
@@ -66,14 +66,14 @@ pub fn max(a, b) {
}
test max {
- let _ = max(Lt, Lt) |> expect:equal(_, Lt)
- let _ = max(Lt, Eq) |> expect:equal(_, Eq)
- let _ = max(Lt, Gt) |> expect:equal(_, Gt)
- let _ = max(Eq, Lt) |> expect:equal(_, Eq)
- let _ = max(Eq, Eq) |> expect:equal(_, Eq)
- let _ = max(Eq, Gt) |> expect:equal(_, Gt)
- let _ = max(Gt, Lt) |> expect:equal(_, Gt)
- let _ = max(Gt, Eq) |> expect:equal(_, Gt)
+ max(Lt, Lt) |> expect:equal(_, Lt)
+ max(Lt, Eq) |> expect:equal(_, Eq)
+ max(Lt, Gt) |> expect:equal(_, Gt)
+ max(Eq, Lt) |> expect:equal(_, Eq)
+ max(Eq, Eq) |> expect:equal(_, Eq)
+ max(Eq, Gt) |> expect:equal(_, Gt)
+ max(Gt, Lt) |> expect:equal(_, Gt)
+ max(Gt, Eq) |> expect:equal(_, Gt)
max(Gt, Gt) |> expect:equal(_, Gt)
}
@@ -86,13 +86,13 @@ pub fn min(a, b) {
}
test min {
- let _ = min(Lt, Lt) |> expect:equal(_, Lt)
- let _ = min(Lt, Eq) |> expect:equal(_, Lt)
- let _ = min(Lt, Gt) |> expect:equal(_, Lt)
- let _ = min(Eq, Lt) |> expect:equal(_, Lt)
- let _ = min(Eq, Eq) |> expect:equal(_, Eq)
- let _ = min(Eq, Gt) |> expect:equal(_, Eq)
- let _ = min(Gt, Lt) |> expect:equal(_, Lt)
- let _ = min(Gt, Eq) |> expect:equal(_, Eq)
+ min(Lt, Lt) |> expect:equal(_, Lt)
+ min(Lt, Eq) |> expect:equal(_, Lt)
+ min(Lt, Gt) |> expect:equal(_, Lt)
+ min(Eq, Lt) |> expect:equal(_, Lt)
+ min(Eq, Eq) |> expect:equal(_, Eq)
+ min(Eq, Gt) |> expect:equal(_, Eq)
+ min(Gt, Lt) |> expect:equal(_, Lt)
+ min(Gt, Eq) |> expect:equal(_, Eq)
min(Gt, Gt) |> expect:equal(_, Gt)
}
diff --git a/src/result.gleam b/src/result.gleam
index 77dc6e5..1e4a0be 100644
--- a/src/result.gleam
+++ b/src/result.gleam
@@ -16,7 +16,7 @@ pub fn is_ok(result) {
}
test is_ok {
- let _ = is_ok(Ok(1)) |> expect:true
+ is_ok(Ok(1)) |> expect:true
is_ok(Error(1)) |> expect:false
}
@@ -28,7 +28,7 @@ pub fn is_error(result) {
}
test is_error {
- let _ = is_error(Ok(1))
+ is_error(Ok(1))
|> expect:false
is_error(Error(1))
@@ -43,7 +43,7 @@ pub fn map(result, fun) {
}
test map {
- let _ = Ok(1)
+ Ok(1)
|> map(_, fn(x) { x + 1 })
|> expect:equal(_, Ok(2))
@@ -60,7 +60,7 @@ pub fn map_error(result, fun) {
}
test map_error {
- let _ = Ok(1)
+ Ok(1)
|> map_error(_, fn(x) { x + 1 })
|> expect:equal(_, Ok(1))
@@ -77,13 +77,13 @@ pub fn flatten(result) {
}
test flatten {
- let _ = flatten(Ok(Ok(1)))
+ flatten(Ok(Ok(1)))
|> expect:equal(_, Ok(1))
- let _ = flatten(Ok(Error(1)))
+ flatten(Ok(Error(1)))
|> expect:equal(_, Error(1))
- let _ = flatten(Error(1))
+ flatten(Error(1))
|> expect:equal(_, Error(1))
flatten(Error(Error(1)))
@@ -102,11 +102,11 @@ pub fn flat_map(result, fun) {
}
test flat_map {
- let _ = Error(1)
+ Error(1)
|> flat_map(_, fn(x) { Ok(x + 1) })
|> expect:equal(_, Error(1))
- let _ = Ok(1)
+ Ok(1)
|> flat_map(_, fn(x) { Ok(x + 1) })
|> expect:equal(_, Ok(2))
@@ -123,7 +123,7 @@ pub fn unwrap(result, default) {
}
test unwrap {
- let _ = unwrap(Ok(1), 50)
+ unwrap(Ok(1), 50)
|> expect:equal(_, 1)
unwrap(Error("nope"), 50)