Fri Aug 29 13:43:42Z 2025
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
Tests summary
((ran 6) (failed 0))
test-cons
: pass(define (test-cons _)
(let1 (q empty/sbral)
(set! q (cons/sbral 'a q))
(⊦= '((1 a)) q)
(⊦= 'a (car/sbral q))
(⊦= '() (cdr/sbral q))
(set! q (cons/sbral 'b q))
(⊦= '((1 b) (1 a)) q)
(⊦= 'b (car/sbral q))
(⊦= '((1 a)) (cdr/sbral q))
(set! q (cons/sbral 'c q))
(⊦= '((3 c (b) (a))) q)
(⊦= 'c (car/sbral q))
(⊦= '((1 b) (1 a)) (cdr/sbral q))
(set! q (cons/sbral 'd q))
(⊦= '((1 d) (3 c (b) (a))) q)
(⊦= 'd (car/sbral q))
(⊦= '((3 c (b) (a))) (cdr/sbral q))
(set! q (cons/sbral 'e q))
(⊦= '((1 e) (1 d) (3 c (b) (a))) q)
(⊦= 'e (car/sbral q))
(⊦= '((1 d) (3 c (b) (a))) (cdr/sbral q))
(set! q (cons/sbral 'f q))
(⊦= '((3 f (e) (d)) (3 c (b) (a))) q)
(⊦= 'f (car/sbral q))
(⊦= '((1 e) (1 d) (3 c (b) (a))) (cdr/sbral q))
(set! q (cons/sbral 'g q))
(⊦= '((7 g (f (e) (d)) (c (b) (a)))) q)
(⊦= 'g (car/sbral q))
(⊦= '((3 f (e) (d)) (3 c (b) (a))) (cdr/sbral q))))
((eta 0.0) (memory #(6291456 965056 1048576)) (stdout "") (stderr ""))
test-ref
: pass(define (test-ref _)
(let1 (q (list->sbral '(a b c d e f g)))
(⊦= 'a (sbral-ref q 0))
(⊦= 'b (sbral-ref q 1))
(⊦= 'c (sbral-ref q 2))
(⊦= 'd (sbral-ref q 3))
(⊦= 'e (sbral-ref q 4))
(⊦= 'f (sbral-ref q 5))
(⊦= 'g (sbral-ref q 6))))
((eta 0.0) (memory #(6291456 966160 1048576)) (stdout "") (stderr ""))
test-list->sbral
: pass(define (test-list->sbral _)
(let* ((l '(a b c d e f g)) (ll (iota 100)))
(⊦= '((7 a (b (c) (d)) (e (f) (g)))) (list->sbral l))
(⊦= '((3 0 (1) (2))
(3 3 (4) (5))
(31
6
(7
(8 (9 (10) (11)) (12 (13) (14)))
(15 (16 (17) (18)) (19 (20) (21))))
(22
(23 (24 (25) (26)) (27 (28) (29)))
(30 (31 (32) (33)) (34 (35) (36)))))
(63
37
(38
(39
(40 (41 (42) (43)) (44 (45) (46)))
(47 (48 (49) (50)) (51 (52) (53))))
(54
(55 (56 (57) (58)) (59 (60) (61)))
(62 (63 (64) (65)) (66 (67) (68)))))
(69
(70
(71 (72 (73) (74)) (75 (76) (77)))
(78 (79 (80) (81)) (82 (83) (84))))
(85
(86 (87 (88) (89)) (90 (91) (92)))
(93 (94 (95) (96)) (97 (98) (99)))))))
(list->sbral ll))))
((eta 0.0) (memory #(6291456 970624 1048576)) (stdout "") (stderr ""))
test-length
: pass(define (test-length _)
(let* ((l '(a b c d e f g)) (q (list->sbral l)))
(⊦= (length l) (length/sbral q))))
((eta 0.0) (memory #(6291456 971872 1048576)) (stdout "") (stderr ""))
test-update
: pass(define (test-update _)
(let1 (q (list->sbral '(a b c d e f g)))
(⊦= '((7 a (b (c) (d)) (e (f) (g)))) q)
(⊦= '((7 a (b (c) (d)) (hello (f) (g)))) (update/sbral 4 'hello q))))
((eta 0.0) (memory #(6291456 973000 1048576)) (stdout "") (stderr ""))
test-identity
: pass(define (test-identity _)
(let1 (l '(a b c d e f g)) (⊦= l (sbral->list (list->sbral l)))))
((eta 0.0) (memory #(6291456 973296 1048576)) (stdout "") (stderr ""))