adding uvector-segment test

This commit is contained in:
Alex Shinn 2020-08-11 10:36:52 +09:00
parent a8e35f90fa
commit 5616d2fb87

View file

@ -11,14 +11,15 @@
(test '#u32(0 1 2 3 4) (u32vector 0 1 2 3 4)) (test '#u32(0 1 2 3 4) (u32vector 0 1 2 3 4))
(test '#u32(0 1 2 3 4 5 6 7 8 9) (test '#u32(0 1 2 3 4 5 6 7 8 9)
(u32vector-unfold (lambda (i x) (values x (+ x 1))) 10 0)) (u32vector-unfold (lambda (i x) (values x (+ x 1))) 10 0))
(test '#u32(0 1 2 3 4 5 6) (u32vector-unfold values 7)) (test '#u32(0 1 2 3 4 5 6) (u32vector-unfold values 7 #f))
;; (test '#u32((0 . 4) (1 . 3) (2 . 2) (3 . 1) (4 . 0))
;; (u32vector-unfold-right (lambda (i x) (values (cons i x) (+ x 1))) 5 0))
(test a2i (u32vector-copy a2i)) (test a2i (u32vector-copy a2i))
(test-assert (not (eqv? a2i (u32vector-copy a2i)))) (test-assert (not (eqv? a2i (u32vector-copy a2i))))
(test '#u32(6 7 8) (u32vector-copy a2i 6)) (test '#u32(6 7 8) (u32vector-copy a2i 6))
(test '#u32(3 4 5) (u32vector-copy a2i 3 6)) (test '#u32(3 4 5) (u32vector-copy a2i 3 6))
(test '#u32(4 3 1) (u32vector-reverse-copy (u32vector 1 3 4)))
(test '#u32(1 2 3 4) (u32vector-reverse-copy '#u32(5 4 3 2 1 0) 1 5)) (test '#u32(1 2 3 4) (u32vector-reverse-copy '#u32(5 4 3 2 1 0) 1 5))
(test '(#u32(#x01 #x02) #u32(#x03 #x04))
(u32vector-segment #u32(1 2 3 4) 2))
(test '#u32(0 1) (u32vector-append '#u32(0) '#u32(1))) (test '#u32(0 1) (u32vector-append '#u32(0) '#u32(1)))
(test '#u32(0 1 2 3) (u32vector-append '#u32(0) '#u32(1 2 3))) (test '#u32(0 1 2 3) (u32vector-append '#u32(0) '#u32(1 2 3)))
(test '#u64(0 1 2 3) (u64vector-append '#u64(0) '#u64(1 2 3))) (test '#u64(0 1 2 3) (u64vector-append '#u64(0) '#u64(1 2 3)))