tests pass

main
Matthew Butterick 6 years ago
parent 3c27002620
commit 59195835f8

@ -1,8 +1,6 @@
#lang info
(define collection 'multi)
(define version "0.0")
(define pkg-authors '(mb))
(define test-omit-paths 'all)
(define deps '("base"
"beautiful-racket-lib"
"rackunit-lib"

@ -58,8 +58,6 @@ https://github.com/mbutterick/restructure/blob/master/src/Array.coffee
(let* ([items (countable->list array)]
[item-count (length items)]
[max-items (if (number? len) len item-count)])
(unless (= item-count max-items)
(raise-argument-error 'Array:encode (format "list or countable with ~a items" max-items) items))
(for ([item (in-list items)])
(send type encode port item ctx))))

@ -1,4 +1,4 @@
#lang info
(define scribblings '(("scribblings/xenomorph.scrbl" ())))
(define compile-omit-paths '("test/test.rkt" "test/~stream.test.rkt" "private/~stream.rkt"))
(define compile-omit-paths '("test/"))

@ -6,9 +6,9 @@
(list (cons 'name (make-object StringT uint8 'utf8))
(cons 'age uint8))))
;; decode a person from a buffer
(define stream-in (make-object DecodeStream #"\4MikeA"))
(define x (send Person decode stream-in))
;; decode a person from a port
(define ip (open-input-bytes #"\4MikeA"))
(define x (send Person decode ip))
(test-module
(check-equal? (dict-ref x 'name) "Mike")

Loading…
Cancel
Save