summary refs log tree commit diff
path: root/tests/test.mew
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-12-09 17:51:21 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-12-09 17:51:21 +0100
commit0c5dec75a7c68ca69384bbc27f8a273976de92d1 (patch)
tree1f8735b20005b1c4832180310bb93c1e1f64ea01 /tests/test.mew
parenta1ef85b5fab8dea3f9d2144102079de198d8ee3e (diff)
downloadmew-0c5dec75a7c68ca69384bbc27f8a273976de92d1.tar.gz
mew-0c5dec75a7c68ca69384bbc27f8a273976de92d1.tar.xz
mew-0c5dec75a7c68ca69384bbc27f8a273976de92d1.zip
add sgn
Diffstat (limited to 'tests/test.mew')
-rw-r--r--tests/test.mew7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test.mew b/tests/test.mew
index 1fe7ec1..72d1e27 100644
--- a/tests/test.mew
+++ b/tests/test.mew
@@ -83,6 +83,13 @@
   (test 5 (mod -16 7))
   (test -2 (mod -16 -7)))
 
+(test-group "sgn"
+  (test -1 (sgn -42))
+  (test 0 (sgn 0))
+  (test #t (eq? 0 (sgn 0.0)))
+  (test #t (eq? 0 (sgn -0.0)))
+  (test 1 (sgn 42)))
+
 (test-group "inc"
   (test 6 (inc 5))
   (test 0 (inc -1))