From c8291571ee1b7947564dc4b2e870e5a0f5bc6229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Wed, 9 Apr 1997 04:29:07 +0200 Subject: [PATCH] Added a few test for the comparison operators. Also fixed several typos that seems to have gon undetected, thanks to a buggy == operator. Rev: src/modules/Gmp/testsuite.in:1.4 --- src/modules/Gmp/testsuite.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/Gmp/testsuite.in b/src/modules/Gmp/testsuite.in index c62b22b802..5f5165daf0 100644 --- a/src/modules/Gmp/testsuite.in +++ b/src/modules/Gmp/testsuite.in @@ -11,6 +11,10 @@ cond( [[ master()->resolv("Gmp") ]], test_eq(Gmp.mpz("10",8),8) test_eq(Gmp.mpz("0",256),'0') + test_eq(Gmp.mpz("17") == "foo", 0) + test_eq(Gmp.mpz("17") != "foo", 1) + test_true(catch(Gmp.mpz("17") < "foo")) + test_eq(clone(Gmp.mpz,99)+1,100) test_eq(clone(Gmp.mpz,100)*10,1000) test_eq(clone(Gmp.mpz,"100")*10.0,1000) @@ -22,8 +26,8 @@ cond( [[ master()->resolv("Gmp") ]], test_eq(clone(Gmp.mpz,66)+11,77) test_eq(clone(Gmp.mpz,66)-11,55) test_eq(clone(Gmp.mpz,17)&18,16) - test_eq(clone(Gmp.mpz,17)|7,31) - test_eq(-clone(Gmp.mpz,17),17) + test_eq(clone(Gmp.mpz,17)|7,23) + test_eq(-clone(Gmp.mpz,17),-17) test_eq((~clone(Gmp.mpz,17)) & 255,0xf0) test_true(stringp((string)clone(Gmp.mpz,17))) test_eq((string)clone(Gmp.mpz,17),"17") @@ -31,7 +35,7 @@ cond( [[ master()->resolv("Gmp") ]], test_eq((int)clone(Gmp.mpz,17),17) test_false(clone(Gmp.mpz,0)) test_true(clone(Gmp.mpz,1)) - test_eq(clone(Gmp.mpz,17)->powm(2,4711),290) + test_eq(clone(Gmp.mpz,17)->powm(12,4711),85) define([[mpz_test_cmp]],[[ test_cmp(clone(Gmp.mpz,$1), $2) -- GitLab