aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLouis Pilfold <louis@lpil.uk>2021-07-18 13:42:19 +0100
committerLouis Pilfold <louis@lpil.uk>2021-07-18 13:42:19 +0100
commit6b449f10ee19c3012cfb8c33d9c687acd4d0d303 (patch)
tree79300b3c598169a88f392b0e3a5545efd7cc0e1c /test
parentd62180206eabec96599b7e00002c211075732264 (diff)
downloadgleam_stdlib-6b449f10ee19c3012cfb8c33d9c687acd4d0d303.tar.gz
gleam_stdlib-6b449f10ee19c3012cfb8c33d9c687acd4d0d303.zip
Remove os module
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()
- }
-}