diff options
author | Jeff Kreeftmeijer <jeffkreeftmeijer@gmail.com> | 2021-01-17 16:03:11 +0100 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2021-01-17 15:10:52 +0000 |
commit | 99d1d948523e33407dc64376a31d0e1c280387f9 (patch) | |
tree | 3e68a947fea6e0fdc26d4281aa33b96f9fb6156e | |
parent | a0ac53188b328fbb60abf9b716ed40cc55683312 (diff) | |
download | gleam_stdlib-99d1d948523e33407dc64376a31d0e1c280387f9.tar.gz gleam_stdlib-99d1d948523e33407dc64376a31d0e1c280387f9.zip |
Ensure atom exists before atom from_string_test
`atom_test.from_string_test/0` uses `ok` to test `atom.from_string/0`. However,
the availability of the `ok` atom seems to be a side effect of running the test
trough eunit.
This patch explicitly creates an atom to make sure it exists before using it to
test `atom.from_string/1`. It removes the assertion on `expect`, which had the
same issue and doesn't seem to test another case.
-rw-r--r-- | test/gleam/atom_test.gleam | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/gleam/atom_test.gleam b/test/gleam/atom_test.gleam index 4617489..228791d 100644 --- a/test/gleam/atom_test.gleam +++ b/test/gleam/atom_test.gleam @@ -2,11 +2,9 @@ import gleam/atom import gleam/should pub fn from_string_test() { - "ok" - |> atom.from_string - |> should.be_ok + atom.create_from_string("this is an existing atom") - "expect" + "this is an existing atom" |> atom.from_string |> should.be_ok |