diff options
author | Louis Pilfold <louis@lpil.uk> | 2019-05-29 21:02:55 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2019-06-02 21:12:59 +0100 |
commit | 5a1f3494eb9517a7b7a332cb74dd10a6a7d32d31 (patch) | |
tree | 5d0d281c66cf71c6e3ca880e6621138a71b95e7b /test/std/atom_test.gleam | |
parent | ee03f5a0465e176e220060164a5ffc408f73ed0d (diff) | |
download | gleam_stdlib-5a1f3494eb9517a7b7a332cb74dd10a6a7d32d31.tar.gz gleam_stdlib-5a1f3494eb9517a7b7a332cb74dd10a6a7d32d31.zip |
Enable namespaced modules
Diffstat (limited to 'test/std/atom_test.gleam')
-rw-r--r-- | test/std/atom_test.gleam | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/std/atom_test.gleam b/test/std/atom_test.gleam new file mode 100644 index 0000000..54e88da --- /dev/null +++ b/test/std/atom_test.gleam @@ -0,0 +1,46 @@ +import std/atom +import std/expect + +pub fn from_string_test() { + "ok" + |> atom:from_string + |> expect:is_ok + + "expect" + |> atom:from_string + |> expect:is_ok + + "this is not an atom we have seen before" + |> atom:from_string + // |> expect:equal(_, Error(AtomNotLoaded)) + |> expect:is_error +} + +pub fn create_from_string_test() { + "ok" + |> atom:create_from_string + |> Ok + |> expect:equal(_, atom:from_string("ok")) + + "expect" + |> atom:create_from_string + |> Ok + |> expect:equal(_, atom:from_string("expect")) + + "this is another atom we have not seen before" + |> atom:create_from_string + |> Ok + |> expect:equal(_, atom:from_string("this is another atom we have not seen before")) +} + +pub fn to_string_test() { + "ok" + |> atom:create_from_string + |> atom:to_string + |> expect:equal(_, "ok") + + "expect" + |> atom:create_from_string + |> atom:to_string + |> expect:equal(_, "expect") +} |