mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
62 lines
1.6 KiB
Plaintext
62 lines
1.6 KiB
Plaintext
(load "Test.carp")
|
|
|
|
(use-all Long Test)
|
|
|
|
(deftest test
|
|
(assert-equal test
|
|
21474836470l
|
|
@&21474836470l
|
|
"copy works as expected")
|
|
(assert-equal test
|
|
1l
|
|
(min 1l 2l)
|
|
"min works as expected")
|
|
(assert-equal test
|
|
2l
|
|
(max 1l 2l)
|
|
"max works as expected")
|
|
(assert-equal test
|
|
1l
|
|
(abs -1l)
|
|
"abs works as expected")
|
|
(assert-equal test
|
|
false
|
|
(even? 3l)
|
|
"even? works as expected")
|
|
(assert-equal test
|
|
true
|
|
(odd? 3l)
|
|
"odd? works as expected")
|
|
(assert-equal test
|
|
1l
|
|
(bit-and 3l 5l)
|
|
"bit-and works as expected")
|
|
(assert-equal test
|
|
5l
|
|
(bit-or 1l 4l)
|
|
"bit-or works as expected")
|
|
(assert-equal test
|
|
4l
|
|
(bit-xor 1l 5l)
|
|
"bit-xor works as expected")
|
|
(assert-equal test
|
|
-2l
|
|
(bit-not 1l)
|
|
"bit-not works as expected")
|
|
(assert-equal test
|
|
8l
|
|
(bit-shift-left 2l 2l)
|
|
"bit-shift-left works as expected")
|
|
(assert-equal test
|
|
2l
|
|
(bit-shift-right 16l 3l)
|
|
"bit-shift-right works as expected")
|
|
(assert-equal test
|
|
-2l
|
|
(neg 2l)
|
|
"neg works as expected")
|
|
(assert-equal test
|
|
2l
|
|
(neg -2l)
|
|
"neg works as expected II"))
|