@@ 140,6 140,7 @@
(module* test #f
(require rackunit
"decode.rkt"
+ "private/util.rkt"
"private/test_data.rkt")
(define (try v)
@@ 166,7 167,18 @@
(for ([pair (in-list list-examples)])
(let ([v (car pair)]
[expected (cdr pair)])
- (check-equal? (try v) expected))))
+ (check-equal? (try v) expected)
+ (check-equal? (try (list->vector v)) expected)))
+ ; indefinite length (sequences)
+ (check-equal? (try (in-list '())) (hex-bytes "9fff"))
+ (check-equal? (try (in-list (list 1 '(2 3) (in-list '(4 5)))))
+ (hex-bytes "9f018202039f0405ffff"))
+ (check-equal? (try (in-list '(1 (2 3) (4 5))))
+ (hex-bytes "9f01820203820405ff"))
+ (check-equal? (try (list 1 '(2 3) (in-list '(4 5))))
+ (hex-bytes "83018202039f0405ff"))
+ (check-equal? (try (list 1 (in-list '(2 3)) '(4 5)))
+ (hex-bytes "83019f0203ff820405")))
(test-case
"Serialization - RFC 8949 Map and Mixed Map/List Examples"