aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2023-04-19 08:27:20 +0100
committerLouis Pilfold <louis@lpil.uk>2023-04-19 08:27:27 +0100
commitae9dd0dec0f1ece194102a06056930a955753253 (patch)
treeb41230933a421b6111520fcc4ca59a00a40114c1
parent242f80a4cf2077c22b8255ff26972f662d160f11 (diff)
downloadgleam_stdlib-ae9dd0dec0f1ece194102a06056930a955753253.tar.gz
gleam_stdlib-ae9dd0dec0f1ece194102a06056930a955753253.zip
Fix format
-rw-r--r--src/gleam/result.gleam2
-rw-r--r--test/gleam/list_test.gleam14
-rw-r--r--test/gleam/string_test.gleam12
3 files changed, 20 insertions, 8 deletions
diff --git a/src/gleam/result.gleam b/src/gleam/result.gleam
index 4e99f13..61e99e9 100644
--- a/src/gleam/result.gleam
+++ b/src/gleam/result.gleam
@@ -171,7 +171,7 @@ pub fn try(
pub fn then(
result: Result(a, e),
apply fun: fn(a) -> Result(b, e),
-)
+) -> Result(b, e) {
try(result, fun)
}
diff --git a/test/gleam/list_test.gleam b/test/gleam/list_test.gleam
index d25f70e..4c76169 100644
--- a/test/gleam/list_test.gleam
+++ b/test/gleam/list_test.gleam
@@ -846,11 +846,21 @@ pub fn key_set_test() {
}
pub fn each_test() {
- list.each([1, 1, 1], fn(x) { let assert 1 = x })
+ list.each(
+ [1, 1, 1],
+ fn(x) {
+ let assert 1 = x
+ },
+ )
|> should.equal(Nil)
// TCO test
- list.each(list.repeat(1, recursion_test_cycles), fn(x) { let assert 1 = x })
+ list.each(
+ list.repeat(1, recursion_test_cycles),
+ fn(x) {
+ let assert 1 = x
+ },
+ )
}
pub fn partition_test() {
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam
index cc87718..3f958d4 100644
--- a/test/gleam/string_test.gleam
+++ b/test/gleam/string_test.gleam
@@ -424,10 +424,8 @@ pub fn to_utf_codepoints_test() {
[g, l, e, a, m]
})
- "🏳️‍🌈"
- |> string.to_utf_codepoints
- |> should.equal({
- // ["🏳", "️", "‍", "🌈"]
+ // ["🏳", "️", "‍", "🌈"]
+ let expected = {
let assert #(
Ok(waving_white_flag),
Ok(variant_selector_16),
@@ -440,7 +438,11 @@ pub fn to_utf_codepoints_test() {
string.utf_codepoint(127_752),
)
[waving_white_flag, variant_selector_16, zero_width_joiner, rainbow]
- })
+ }
+
+ "🏳️‍🌈"
+ |> string.to_utf_codepoints
+ |> should.equal(expected)
}
pub fn from_utf_codepoints_test() {