From 23101250f40d1cd9f9f0b107d65cc534fadcfc6a Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Fri, 26 Apr 2024 20:43:39 -0300 Subject: [PATCH] missing formatting --- test/gleam/float_test.gleam | 1 + test/gleam/regex_test.gleam | 27 ++++++++-- test/gleam/string_builder_test.gleam | 1 - test/gleam/string_test.gleam | 81 ++++++++++++++-------------- test/gleam/uri_test.gleam | 1 + 5 files changed, 66 insertions(+), 45 deletions(-) diff --git a/test/gleam/float_test.gleam b/test/gleam/float_test.gleam index c3d9be4..abcfd90 100644 --- a/test/gleam/float_test.gleam +++ b/test/gleam/float_test.gleam @@ -1,4 +1,5 @@ import gleam/float + // import gleam/int // import gleam/iterator // import gleam/list diff --git a/test/gleam/regex_test.gleam b/test/gleam/regex_test.gleam index 2cb0425..392b91b 100644 --- a/test/gleam/regex_test.gleam +++ b/test/gleam/regex_test.gleam @@ -1,26 +1,33 @@ import gleam/option.{None, Some} + // import gleam/regex.{Match, Options} import gleam/regex.{Match} import gleam/should @target(erlang) const word = "\\w" + @target(erlang) const space = "\\s" + @target(erlang) const digit = "\\d" @target(javascript) const word = "\\w" + @target(javascript) const space = "\\s" + @target(javascript) const digit = "\\d" @target(nix) const word = "[[:alnum:]_]" + @target(nix) const space = "[[:space:]]" + @target(nix) const digit = "[0-9]" @@ -159,7 +166,8 @@ pub fn scan_test() { regex.scan(re, "你好 42 世界") |> should.equal([Match(content: "42", submatches: [Some("42")])]) - let assert Ok(re) = regex.from_string("([+|\\-])?(" <> digit <> "+)(" <> word <> "+)?") + let assert Ok(re) = + regex.from_string("([+|\\-])?(" <> digit <> "+)(" <> word <> "+)?") regex.scan(re, "+36kg") |> should.equal([ Match(content: "+36kg", submatches: [Some("+"), Some("36"), Some("kg")]), @@ -180,7 +188,19 @@ pub fn scan_test() { |> should.equal([]) let assert Ok(re) = - regex.from_string("var" <> space <> "*(" <> word <> "+)" <> space <> "*(int|string)?" <> space <> "*=" <> space <> "*(.*)") + regex.from_string( + "var" + <> space + <> "*(" + <> word + <> "+)" + <> space + <> "*(int|string)?" + <> space + <> "*=" + <> space + <> "*(.*)", + ) regex.scan(re, "var age int = 32") |> should.equal([ Match(content: "var age int = 32", submatches: [ @@ -195,7 +215,8 @@ pub fn scan_test() { Match(content: "var age = 32", submatches: [Some("age"), None, Some("32")]), ]) - let assert Ok(re) = regex.from_string("let (" <> word <> "+) = (" <> word <> "+)") + let assert Ok(re) = + regex.from_string("let (" <> word <> "+) = (" <> word <> "+)") regex.scan(re, "let age = 32") |> should.equal([ Match(content: "let age = 32", submatches: [Some("age"), Some("32")]), diff --git a/test/gleam/string_builder_test.gleam b/test/gleam/string_builder_test.gleam index 05d342a..31a83df 100644 --- a/test/gleam/string_builder_test.gleam +++ b/test/gleam/string_builder_test.gleam @@ -58,7 +58,6 @@ pub fn reverse_test() { |> string_builder.reverse |> string_builder.to_string |> should.equal("👶🏿") - // "👶🏿" // |> string_builder.from_string // |> string_builder.reverse diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam index f3660dc..25cd00d 100644 --- a/test/gleam/string_test.gleam +++ b/test/gleam/string_test.gleam @@ -5,9 +5,9 @@ import gleam/should import gleam/string pub fn length_test() { -// Graphemes not yet supported -// string.length("ß↑e̊") -// |> should.equal(3) + // Graphemes not yet supported + // string.length("ß↑e̊") + // |> should.equal(3) string.length("Gleam") |> should.equal(5) @@ -47,10 +47,10 @@ pub fn reverse_test() { |> string.reverse |> should.equal("ÖÄÅ") -// Graphemes not yet supported -// "👶🏿" -// |> string.reverse -// |> should.equal("👶🏿") + // Graphemes not yet supported + // "👶🏿" + // |> string.reverse + // |> should.equal("👶🏿") "👶🏿" |> string.reverse @@ -376,37 +376,36 @@ pub fn to_graphemes_test() { |> string.to_graphemes |> should.equal(["a", "b", "c"]) -// "🌷🎁💩😜👍🏳️‍🌈" -// |> string.to_graphemes -// |> should.equal(["🌷", "🎁", "💩", "😜", "👍", "🏳️‍🌈"]) + // "🌷🎁💩😜👍🏳️‍🌈" + // |> string.to_graphemes + // |> should.equal(["🌷", "🎁", "💩", "😜", "👍", "🏳️‍🌈"]) -// "Ĺo͂řȩm̅" -// |> string.to_graphemes -// |> should.equal(["Ĺ", "o͂", "ř", "ȩ", "m̅"]) + // "Ĺo͂řȩm̅" + // |> string.to_graphemes + // |> should.equal(["Ĺ", "o͂", "ř", "ȩ", "m̅"]) "뎌쉐" |> string.to_graphemes |> should.equal(["뎌", "쉐"]) - -// "👨‍👩‍👦‍👦" -// |> string.to_graphemes() -// |> should.equal(["👨‍👩‍👦‍👦"]) - -// "ごん゙に゙ぢば" -// |> string.to_graphemes() -// |> should.equal(["ご", "ん゙", "に゙", "ぢ", "ば"]) - -// "パピプペポ" -// |> string.to_graphemes() -// |> should.equal(["パ", "ピ", "プ", "ペ", "ポ"]) - -// "Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞" -// |> string.to_graphemes -// |> should.equal([ -// "Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍", "A̴̵̜̰͔ͫ͗͢", "L̠ͨͧͩ͘", -// "G̴̻͈͍͔̹̑͗̎̅͛́", "Ǫ̵̹̻̝̳͂̌̌͘", -// "!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞", -// ]) + // "👨‍👩‍👦‍👦" + // |> string.to_graphemes() + // |> should.equal(["👨‍👩‍👦‍👦"]) + + // "ごん゙に゙ぢば" + // |> string.to_graphemes() + // |> should.equal(["ご", "ん゙", "に゙", "ぢ", "ば"]) + + // "パピプペポ" + // |> string.to_graphemes() + // |> should.equal(["パ", "ピ", "プ", "ペ", "ポ"]) + + // "Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞" + // |> string.to_graphemes + // |> should.equal([ + // "Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍", "A̴̵̜̰͔ͫ͗͢", "L̠ͨͧͩ͘", + // "G̴̻͈͍͔̹̑͗̎̅͛́", "Ǫ̵̹̻̝̳͂̌̌͘", + // "!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞", + // ]) } pub fn to_utf_codepoints_test() { @@ -520,10 +519,10 @@ pub fn first_test() { |> string.first |> should.equal(Ok("g")) -// No grapheme popping yet on Nix -// "⭐️ Gleam" -// |> string.first -// |> should.equal(Ok("⭐️")) + // No grapheme popping yet on Nix + // "⭐️ Gleam" + // |> string.first + // |> should.equal(Ok("⭐️")) "a" |> string.first @@ -543,10 +542,10 @@ pub fn last_test() { |> string.last |> should.equal(Ok(" ")) -// Graphemes not yet supported -// "եոգլի" -// |> string.last -// |> should.equal(Ok("ի")) + // Graphemes not yet supported + // "եոգլի" + // |> string.last + // |> should.equal(Ok("ի")) "a" |> string.last diff --git a/test/gleam/uri_test.gleam b/test/gleam/uri_test.gleam index 0a3d773..93f09a6 100644 --- a/test/gleam/uri_test.gleam +++ b/test/gleam/uri_test.gleam @@ -4,6 +4,7 @@ import gleam/option.{None, Some} import gleam/should + // import gleam/string import gleam/uri