diff options
author | Louis Pilfold <louis@lpil.uk> | 2019-04-14 13:03:24 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2019-04-14 13:03:32 +0000 |
commit | 8cfa606f3834cf7d05f5011bc68295a9d84263dc (patch) | |
tree | fa7edc8ea53426b072f35d3d61e0ab821c8d5feb /test/atom_test.gleam | |
parent | ae5597c1b27982aabe74eb16d5b0c890802730d9 (diff) | |
download | gleam_stdlib-8cfa606f3834cf7d05f5011bc68295a9d84263dc.tar.gz gleam_stdlib-8cfa606f3834cf7d05f5011bc68295a9d84263dc.zip |
stdlib: Split out tests
Diffstat (limited to 'test/atom_test.gleam')
-rw-r--r-- | test/atom_test.gleam | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/atom_test.gleam b/test/atom_test.gleam new file mode 100644 index 0000000..60686ab --- /dev/null +++ b/test/atom_test.gleam @@ -0,0 +1,46 @@ +import atom +import 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") +} |