about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-08-16 00:27:53 +0530
committerAndinus <andinus@nand.sh>2021-08-16 00:27:53 +0530
commitf60c2fb28918e4485fb6391356265bf14f1a9f91 (patch)
tree1f2b94dda82c50f376b91b42657b34197a6e4689
parent34fff163576418fb7daae0a787deffa3dac42e39 (diff)
downloadtaurus-f60c2fb28918e4485fb6391356265bf14f1a9f91.tar.gz
Add tests for seconds-to-str v0.1.0
-rw-r--r--t/00-basic.rakutest6
-rw-r--r--t/01-seconds-to-str.rakutest10
2 files changed, 16 insertions, 0 deletions
diff --git a/t/00-basic.rakutest b/t/00-basic.rakutest
new file mode 100644
index 0000000..ca3938b
--- /dev/null
+++ b/t/00-basic.rakutest
@@ -0,0 +1,6 @@
+use Test;
+
+plan 2;
+
+use-ok 'Taurus::CLI';
+use-ok 'Taurus::Seconds';
diff --git a/t/01-seconds-to-str.rakutest b/t/01-seconds-to-str.rakutest
new file mode 100644
index 0000000..85c5076
--- /dev/null
+++ b/t/01-seconds-to-str.rakutest
@@ -0,0 +1,10 @@
+use Test;
+use Taurus::Seconds;
+
+plan 5;
+
+is seconds-to-str(59), "59s", "Less than 60";
+is seconds-to-str(3599), "59m 59s", "Less than 3600";
+is seconds-to-str(86399), "23h 59m 59s", "Less than 86400";
+is seconds-to-str(86401), "1d  0h  0m  1s", "More than 86400";
+throws-like { seconds-to-str(-1) }, Exception, message => /:s Constraint type check failed in binding to parameter/, "Negative Int check";