ikarus/src/old-tests/tests-1.7-req.scm

81 lines
3.5 KiB
Scheme
Raw Normal View History

2006-11-23 19:33:45 -05:00
(add-tests-with-string-output "binary primitives"
2006-11-23 19:38:26 -05:00
[(fxlognot -7) => "6\n"]
[(fxlognot (fxlogor (fxlognot 7) 1)) => "6\n"]
[(fxlognot (fxlogor (fxlognot 7) (fxlognot 2))) => "2\n"]
[(fxlogand (fxlognot (fxlognot 12)) (fxlognot (fxlognot 12))) => "12\n"]
[(fx+ (fx+ 1 2) (fx+ 3 4)) => "10\n"]
[(fx+ (fx+ 1 2) (fx+ 3 -4)) => "2\n"]
[(fx+ (fx+ 1 2) (fx+ -3 4)) => "4\n"]
[(fx+ (fx+ 1 2) (fx+ -3 -4)) => "-4\n"]
[(fx+ (fx+ 1 -2) (fx+ 3 4)) => "6\n"]
[(fx+ (fx+ 1 -2) (fx+ 3 -4)) => "-2\n"]
[(fx+ (fx+ 1 -2) (fx+ -3 4)) => "0\n"]
[(fx+ (fx+ 1 -2) (fx+ -3 -4)) => "-8\n"]
[(fx+ (fx+ -1 2) (fx+ 3 4)) => "8\n"]
[(fx+ (fx+ -1 2) (fx+ 3 -4)) => "0\n"]
[(fx+ (fx+ -1 2) (fx+ -3 4)) => "2\n"]
[(fx+ (fx+ -1 2) (fx+ -3 -4)) => "-6\n"]
[(fx+ (fx+ -1 -2) (fx+ 3 4)) => "4\n"]
[(fx+ (fx+ -1 -2) (fx+ 3 -4)) => "-4\n"]
[(fx+ (fx+ -1 -2) (fx+ -3 4)) => "-2\n"]
[(fx+ (fx+ -1 -2) (fx+ -3 -4)) => "-10\n"]
[(fx+ (fx+ (fx+ (fx+ (fx+ (fx+ (fx+ (fx+ 1 2) 3) 4) 5) 6) 7) 8) 9) => "45\n"]
[(fx+ 1 (fx+ 2 (fx+ 3 (fx+ 4 (fx+ 5 (fx+ 6 (fx+ 7 (fx+ 8 9)))))))) => "45\n"]
[(fx+ (fx+ (fx+ (fx+ 1 2) (fx+ 3 4)) (fx+ (fx+ 5 6) (fx+ 7 8)))
(fx+ (fx+ (fx+ 9 10) (fx+ 11 12)) (fx+ (fx+ 13 14) (fx+ 15 16))))
=> "136\n"]
2006-11-23 19:33:45 -05:00
[(fx- (fx- 1 2) (fx- 3 4)) => "0\n"]
[(fx- (fx- 1 2) (fx- 3 -4)) => "-8\n"]
[(fx- (fx- 1 2) (fx- -3 4)) => "6\n"]
[(fx- (fx- 1 2) (fx- -3 -4)) => "-2\n"]
[(fx- (fx- 1 -2) (fx- 3 4)) => "4\n"]
[(fx- (fx- 1 -2) (fx- 3 -4)) => "-4\n"]
[(fx- (fx- 1 -2) (fx- -3 4)) => "10\n"]
[(fx- (fx- 1 -2) (fx- -3 -4)) => "2\n"]
[(fx- (fx- -1 2) (fx- 3 4)) => "-2\n"]
[(fx- (fx- -1 2) (fx- 3 -4)) => "-10\n"]
[(fx- (fx- -1 2) (fx- -3 4)) => "4\n"]
[(fx- (fx- -1 2) (fx- -3 -4)) => "-4\n"]
[(fx- (fx- -1 -2) (fx- 3 4)) => "2\n"]
[(fx- (fx- -1 -2) (fx- 3 -4)) => "-6\n"]
[(fx- (fx- -1 -2) (fx- -3 4)) => "8\n"]
[(fx- (fx- -1 -2) (fx- -3 -4)) => "0\n"]
[(fx- (fx- (fx- (fx- (fx- (fx- (fx- (fx- 1 2) 3) 4) 5) 6) 7) 8) 9) => "-43\n"]
[(fx- 1 (fx- 2 (fx- 3 (fx- 4 (fx- 5 (fx- 6 (fx- 7 (fx- 8 9)))))))) => "5\n"]
[(fx- (fx- (fx- (fx- 1 2) (fx- 3 4)) (fx- (fx- 5 6) (fx- 7 8)))
(fx- (fx- (fx- 9 10) (fx- 11 12)) (fx- (fx- 13 14) (fx- 15 16))))
=> "0\n"]
[(fx* (fx* (fx* (fx* 2 3) (fx* 4 5)) (fx* (fx* 6 7) (fx* 8 9)))
(fx* (fx* (fx* 2 3) (fx* 2 3)) (fx* (fx* 2 3) (fx* 2 3))))
=> "470292480\n"]
[(fxlognot (fxlogor (fxlognot 7) 1)) => "6\n"]
[(fxlognot (fxlogor (fxlognot 7) (fxlognot 2))) => "2\n"]
[(fxlogand (fxlognot (fxlognot 12)) (fxlognot (fxlognot 12))) => "12\n"]
[(fx= (fx+ 13 3) (fx+ 10 6)) => "#t\n"]
[(fx= (fx+ 13 0) (fx+ 10 6)) => "#f\n"]
[(fx= (fx+ 12 1) (fx+ -12 -1)) => "#f\n"]
[(fx< (fx+ 10 6) (fx+ 13 1)) => "#f\n"]
[(fx< (fx+ 10 6) (fx+ 13 3)) => "#f\n"]
[(fx< (fx+ 10 6) (fx+ 13 31)) => "#t\n"]
[(fx< (fx+ 12 1) (fx+ -12 -1)) => "#f\n"]
[(fx< (fx+ -12 -1) (fx+ 12 1)) => "#t\n"]
[(fx<= (fx+ 10 6) (fx+ 13 1)) => "#f\n"]
[(fx<= (fx+ 10 6) (fx+ 13 3)) => "#t\n"]
[(fx<= (fx+ 10 6) (fx+ 13 31)) => "#t\n"]
[(fx<= (fx+ 12 1) (fx+ -12 -1)) => "#f\n"]
[(fx<= (fx+ -12 -1) (fx+ 12 1)) => "#t\n"]
[(fx> (fx+ 10 6) (fx+ 13 1)) => "#t\n"]
[(fx> (fx+ 10 6) (fx+ 13 3)) => "#f\n"]
[(fx> (fx+ 10 6) (fx+ 13 31)) => "#f\n"]
[(fx> (fx+ 12 1) (fx+ -12 -1)) => "#t\n"]
[(fx> (fx+ -12 -1) (fx+ 12 1)) => "#f\n"]
[(fx>= (fx+ 10 6) (fx+ 13 1)) => "#t\n"]
[(fx>= (fx+ 10 6) (fx+ 13 3)) => "#t\n"]
[(fx>= (fx+ 10 6) (fx+ 13 31)) => "#f\n"]
[(fx>= (fx+ 12 1) (fx+ -12 -1)) => "#t\n"]
[(fx>= (fx+ -12 -1) (fx+ 12 1)) => "#f\n"]
)