diff options
Diffstat (limited to 'src/atom.gleam')
-rw-r--r-- | src/atom.gleam | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/atom.gleam b/src/atom.gleam index e887a01..67d040d 100644 --- a/src/atom.gleam +++ b/src/atom.gleam @@ -1,5 +1,3 @@ -import expect - pub external type Atom; pub enum AtomNotLoaded = @@ -8,20 +6,6 @@ pub enum AtomNotLoaded = pub external fn from_string(String) -> Result(Atom, AtomNotLoaded) = "gleam__stdlib" "atom_from_string"; -test from_string { - "ok" - |> from_string - |> expect:is_ok - - "expect" - |> from_string - |> expect:is_ok - - "this is not an atom we have seen before" - |> from_string - |> expect:equal(_, Error(AtomNotLoaded)) -} - // This function can create a new atom if one does not already exist for // the given string. Atoms are not garbage collected so this can result // in a memory leak if called over time on new values @@ -29,36 +13,5 @@ test from_string { pub external fn create_from_string(String) -> Atom = "gleam__stdlib" "atom_create_from_string"; -test create_from_string { - let ok = fn(x) { Ok(x) } - - "ok" - |> create_from_string - |> ok - |> expect:equal(_, from_string("ok")) - - "expect" - |> create_from_string - |> ok - |> expect:equal(_, from_string("expect")) - - "this is another atom we have not seen before" - |> create_from_string - |> ok - |> expect:equal(_, from_string("this is another atom we have not seen before")) -} - pub external fn to_string(Atom) -> String = "gleam__stdlib" "atom_to_string"; - -test to_string { - "ok" - |> create_from_string - |> to_string - |> expect:equal(_, "ok") - - "expect" - |> create_from_string - |> to_string - |> expect:equal(_, "expect") -} |