aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/gleam/os_test.gleam49
1 files changed, 0 insertions, 49 deletions
diff --git a/test/gleam/os_test.gleam b/test/gleam/os_test.gleam
deleted file mode 100644
index b3d799d..0000000
--- a/test/gleam/os_test.gleam
+++ /dev/null
@@ -1,49 +0,0 @@
-if erlang {
- import gleam/map
- import gleam/os
- import gleam/io
- import gleam/should
-
- pub fn env_test() {
- os.insert_env("GLEAM_TEST", "hello")
- os.get_env()
- |> map.get("GLEAM_TEST")
- |> should.equal(Ok("hello"))
-
- os.delete_env("GLEAM_TEST")
- os.get_env()
- |> map.get("GLEAM_TEST")
- |> should.equal(Error(Nil))
- }
-
- pub fn unicode_test() {
- os.insert_env("GLEAM_UNICODE_TEST", "Iñtërnâtiônà£ißætiøn☃💩")
- os.get_env()
- |> map.get("GLEAM_UNICODE_TEST")
- |> should.equal(Ok("Iñtërnâtiônà£ißætiøn☃💩"))
- }
-
- pub fn system_time_test() {
- let june_12_2020 = 1591966971
- { os.system_time(os.Second) > june_12_2020 }
- |> should.equal(True)
- { os.system_time(os.Second) < june_12_2020 * 1000 }
- |> should.equal(True)
- { os.system_time(os.Millisecond) > june_12_2020 * 1000 }
- |> should.equal(True)
- { os.system_time(os.Millisecond) < june_12_2020 * 1000000 }
- |> should.equal(True)
- }
-
- pub fn erlang_timestamp_test() {
- // in microseconds
- let june_12_2020 = 1591966971000000
- let #(mega_seconds, seconds, micro_seconds) = os.erlang_timestamp()
-
- let stamp_as_micro =
- { mega_seconds * 1_000_000 + seconds } * 1_000_000 + micro_seconds
-
- { stamp_as_micro > june_12_2020 }
- |> should.be_true()
- }
-}