mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
36 lines
1.2 KiB
Scheme
36 lines
1.2 KiB
Scheme
|
|
(import (chibi) (srfi 33) (chibi test))
|
|
|
|
(test-begin "srfi-33")
|
|
|
|
(test 1 (arithmetic-shift 1 0))
|
|
(test 2 (arithmetic-shift 1 1))
|
|
(test 4 (arithmetic-shift 1 2))
|
|
(test 8 (arithmetic-shift 1 3))
|
|
(test 16 (arithmetic-shift 1 4))
|
|
(test (expt 2 31) (arithmetic-shift 1 31))
|
|
(test (expt 2 32) (arithmetic-shift 1 32))
|
|
(test (expt 2 33) (arithmetic-shift 1 33))
|
|
(test (expt 2 63) (arithmetic-shift 1 63))
|
|
(test (expt 2 64) (arithmetic-shift 1 64))
|
|
(test (expt 2 65) (arithmetic-shift 1 65))
|
|
(test (expt 2 127) (arithmetic-shift 1 127))
|
|
(test (expt 2 128) (arithmetic-shift 1 128))
|
|
(test (expt 2 129) (arithmetic-shift 1 129))
|
|
|
|
(test -1 (arithmetic-shift -1 0))
|
|
(test -2 (arithmetic-shift -1 1))
|
|
(test -4 (arithmetic-shift -1 2))
|
|
(test -8 (arithmetic-shift -1 3))
|
|
(test -16 (arithmetic-shift -1 4))
|
|
(test (- (expt 2 31)) (arithmetic-shift -1 31))
|
|
(test (- (expt 2 32)) (arithmetic-shift -1 32))
|
|
(test (- (expt 2 33)) (arithmetic-shift -1 33))
|
|
(test (- (expt 2 63)) (arithmetic-shift -1 63))
|
|
(test (- (expt 2 64)) (arithmetic-shift -1 64))
|
|
(test (- (expt 2 65)) (arithmetic-shift -1 65))
|
|
(test (- (expt 2 127)) (arithmetic-shift -1 127))
|
|
(test (- (expt 2 128)) (arithmetic-shift -1 128))
|
|
(test (- (expt 2 129)) (arithmetic-shift -1 129))
|
|
|
|
(test-end)
|