diff options
Diffstat (limited to 'src/gleam_stdlib.erl')
-rw-r--r-- | src/gleam_stdlib.erl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gleam_stdlib.erl b/src/gleam_stdlib.erl index 3bb762d..03f26e6 100644 --- a/src/gleam_stdlib.erl +++ b/src/gleam_stdlib.erl @@ -6,7 +6,7 @@ atom_create_from_string/1, atom_to_string/1, map_fetch/2, iodata_append/2, iodata_prepend/2, identity/1, decode_int/1, decode_string/1, decode_bool/1, decode_float/1, decode_thunk/1, decode_atom/1, - decode_pair/1, decode_list/1, decode_field/2, parse_int/1, parse_float/1]). + decode_pair/1, decode_list/1, decode_field/2, parse_int/1, parse_float/1, compare_strings/2]). expect_equal(Actual, Expected) -> ?assertEqual(Expected, Actual). expect_not_equal(Actual, Expected) -> ?assertNotEqual(Expected, Actual). @@ -90,3 +90,13 @@ parse_float(String) -> _ -> {error, nil} end. + +compare_strings(Lhs, Rhs) -> + if + Lhs == Rhs -> + eq; + Lhs < Rhs -> + lt; + true -> + gt + end. |