diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-04-05 21:31:39 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-04-05 21:31:39 -0700 |
commit | 9c51abd7297034b9b109eafcf01021fbd2876ba4 (patch) | |
tree | ecaf2d7eed8ea106e193c4811301df87a39d3981 /testcases-cons | |
parent | 26dba3a636e0587e621941842bf0af96afa45f97 (diff) | |
download | cppawk-9c51abd7297034b9b109eafcf01021fbd2876ba4.tar.gz cppawk-9c51abd7297034b9b109eafcf01021fbd2876ba4.tar.bz2 cppawk-9c51abd7297034b9b109eafcf01021fbd2876ba4.zip |
New function equalize.
Diffstat (limited to 'testcases-cons')
-rw-r--r-- | testcases-cons | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/testcases-cons b/testcases-cons index d95dbef..b2fce7f 100644 --- a/testcases-cons +++ b/testcases-cons @@ -369,7 +369,48 @@ BEGIN { 0 1 brk +0 +1 1 +0 +0 +-- +24: +$cppawk ' +#include <cons.h> + +function same(left, right) +{ + return equalize(left) == equalize(right) +} + +BEGIN { + print same("", undef), same(0, 0), same(-1, -1), same("", "") + print same("", "a"), same(0, 1), same(-1, 1), same("Tabc", "xyz") + print same("1", "1.0"), same(box("abc"), "abc") + print same(box(undef), box(undef)) + print same(cons("1", "2"), cons("1.0", "2.0")) + print same(cons("1", "3"), cons("1.0", "2.0")) + print same(cons("3", "2"), cons("1.0", "2.0")) + print same(cons("1a", "2a"), cons("1b", "2b")) + print "brk" + print same(box_str(1.0), 1.0) + print same(box_str(1.0), box_str("1")) + print same(box_str(1.0), box_str(1.0)) + print same(box_str(1.0), "1.0") + print same("1.0", box_str(1.0)) +}' +: +1 1 1 1 +0 0 0 0 +1 1 +1 +1 +0 +0 +1 +brk +0 1 1 0 |