aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2023-07-23 19:51:17 +0100
committerLouis Pilfold <louis@lpil.uk>2023-07-23 19:51:17 +0100
commit6065a2102d6a77e8dd1a8cb71ed9394cefc80802 (patch)
tree87b9db18b995495199ef241c079b025a2bbc92cc /test
parent28606a3975ee71cde075e1416ca2c8432ab17f68 (diff)
downloadgleam_stdlib-6065a2102d6a77e8dd1a8cb71ed9394cefc80802.tar.gz
gleam_stdlib-6065a2102d6a77e8dd1a8cb71ed9394cefc80802.zip
Tweak
Diffstat (limited to 'test')
-rw-r--r--test/gleam/string_test.gleam58
1 files changed, 22 insertions, 36 deletions
diff --git a/test/gleam/string_test.gleam b/test/gleam/string_test.gleam
index c072800..5b9b2a5 100644
--- a/test/gleam/string_test.gleam
+++ b/test/gleam/string_test.gleam
@@ -999,55 +999,45 @@ fn string_to_erlang_atom(a: String) -> Dynamic
@target(erlang)
pub fn inspect_erlang_atom_is_valid_in_gleam_test() {
- string_to_erlang_atom("a_common_erlang_atom_is_valid_in_gleam")
+ string_to_erlang_atom("one_two")
|> string.inspect
- |> should.equal("ACommonErlangAtomIsValidInGleam")
+ |> should.equal("OneTwo")
- string_to_erlang_atom(
- "an_erlang_atom_with_1_or_many_non_leading_digits_is_valid_in_gleam",
- )
+ string_to_erlang_atom("one1_two")
+ |> string.inspect
+ |> should.equal("One1Two")
+
+ string_to_erlang_atom("one1two")
|> string.inspect
- |> should.equal("AnErlangAtomWith1OrManyNonLeadingDigitsIsValidInGleam")
+ |> should.equal("One1two")
}
@target(erlang)
pub fn inspect_erlang_atom_with_a_leading_underscore_is_invalid_in_gleam_test() {
- string_to_erlang_atom(
- "_an_erlang_atom_with_a_leading_underscore_is_invalid_in_gleam",
- )
+ string_to_erlang_atom("_ok")
|> string.inspect
- |> should.equal(
- "//erl('_an_erlang_atom_with_a_leading_underscore_is_invalid_in_gleam')",
- )
+ |> should.equal("//erl('_ok')")
}
@target(erlang)
pub fn inspect_erlang_atom_with_a_trailing_underscore_is_invalid_in_gleam_test() {
- string_to_erlang_atom(
- "an_erlang_atom_with_a_trailing_underscore_is_invalid_in_gleam_",
- )
+ string_to_erlang_atom("ok_")
|> string.inspect
- |> should.equal(
- "//erl('an_erlang_atom_with_a_trailing_underscore_is_invalid_in_gleam_')",
- )
+ |> should.equal("//erl('ok_')")
}
@target(erlang)
pub fn inspect_erlang_atom_with_a_double_underscore_is_invalid_in_gleam_test() {
- string_to_erlang_atom("an_erlang_atom_with_a_double__underscore_is_invalid")
+ string_to_erlang_atom("ok__ok")
|> string.inspect
- |> should.equal(
- "//erl('an_erlang_atom_with_a_double__underscore_is_invalid')",
- )
+ |> should.equal("//erl('ok__ok')")
}
@target(erlang)
pub fn inspect_erlang_atom_with_white_spaces_is_invalid_in_gleam_test() {
- string_to_erlang_atom("an erlang atom with white spaces is invalid in gleam")
+ string_to_erlang_atom("ok ok")
|> string.inspect
- |> should.equal(
- "//erl('an erlang atom with white spaces is invalid in gleam')",
- )
+ |> should.equal("//erl('ok ok')")
}
@target(erlang)
@@ -1060,24 +1050,20 @@ pub fn inspect_erlang_atom_that_is_an_empty_string_is_invalid_in_gleam_test() {
@target(erlang)
pub fn inspect_erlang_atom_with_uppercases_invalid_in_gleam_test() {
- string_to_erlang_atom("AnErlangAtomWithUpperCasesIsInvalidInGleam")
+ string_to_erlang_atom("Upper")
|> string.inspect
- |> should.equal("//erl('AnErlangAtomWithUpperCasesIsInvalidInGleam')")
+ |> should.equal("//erl('Upper')")
}
@target(erlang)
pub fn inspect_erlang_atom_with_leading_digit_invalid_in_gleam_test() {
- string_to_erlang_atom(
- "1_erlang_atom_with_a_leading_digit_is_invalid_in_gleam",
- )
+ string_to_erlang_atom("1_ok")
|> string.inspect
- |> should.equal(
- "//erl('1_erlang_atom_with_a_leading_digit_is_invalid_in_gleam')",
- )
+ |> should.equal("//erl('1_ok')")
- string_to_erlang_atom("1ErlangAtomWithALeadingDigitIsInvalidInGleam")
+ string_to_erlang_atom("1Ok")
|> string.inspect
- |> should.equal("//erl('1ErlangAtomWithALeadingDigitIsInvalidInGleam')")
+ |> should.equal("//erl('1Ok')")
}
pub fn byte_size_test() {