|
|
|
@ -114,7 +114,7 @@ https://github.com/mbutterick/restructure/blob/master/test/Pointer.coffee
|
|
|
|
|
x:pointers-key null))
|
|
|
|
|
(encode (x:pointer) 10 #:parent parent)
|
|
|
|
|
(check-equal? (hash-ref parent x:pointer-offset-key) 2)
|
|
|
|
|
(check-equal? (hash-ref parent x:pointers-key) (list (mhasheq 'type uint8
|
|
|
|
|
(check-equal? (hash-ref parent x:pointers-key) (list (mhasheq x:pointer-type-key uint8
|
|
|
|
|
x:val-key 10
|
|
|
|
|
x:parent-key parent)))
|
|
|
|
|
(check-equal? (get-output-bytes (current-output-port)) (bytes 1))))
|
|
|
|
@ -128,7 +128,7 @@ https://github.com/mbutterick/restructure/blob/master/test/Pointer.coffee
|
|
|
|
|
x:pointers-key null))
|
|
|
|
|
(encode (x:pointer #:relative-to 'immediate) 10 #:parent parent)
|
|
|
|
|
(check-equal? (hash-ref parent x:pointer-offset-key) 2)
|
|
|
|
|
(check-equal? (hash-ref parent x:pointers-key) (list (mhasheq 'type uint8
|
|
|
|
|
(check-equal? (hash-ref parent x:pointers-key) (list (mhasheq x:pointer-type-key uint8
|
|
|
|
|
x:val-key 10
|
|
|
|
|
x:parent-key parent)))
|
|
|
|
|
(check-equal? (get-output-bytes (current-output-port)) (bytes 0))))
|
|
|
|
@ -142,7 +142,7 @@ https://github.com/mbutterick/restructure/blob/master/test/Pointer.coffee
|
|
|
|
|
x:pointers-key null)))
|
|
|
|
|
(encode (x:pointer #:relative-to 'parent) 10 #:parent parent)
|
|
|
|
|
(check-equal? (hash-ref* parent x:parent-key x:pointer-offset-key) 6)
|
|
|
|
|
(check-equal? (hash-ref* parent x:parent-key x:pointers-key) (list (mhasheq 'type uint8
|
|
|
|
|
(check-equal? (hash-ref* parent x:parent-key x:pointers-key) (list (mhasheq x:pointer-type-key uint8
|
|
|
|
|
x:val-key 10
|
|
|
|
|
x:parent-key parent)))
|
|
|
|
|
(check-equal? (get-output-bytes (current-output-port)) (bytes 2))))
|
|
|
|
@ -159,7 +159,7 @@ https://github.com/mbutterick/restructure/blob/master/test/Pointer.coffee
|
|
|
|
|
(encode (x:pointer #:relative-to 'global) 10 #:parent parent)
|
|
|
|
|
(check-equal? (hash-ref* parent x:parent-key x:parent-key x:parent-key x:pointer-offset-key) 6)
|
|
|
|
|
(check-equal? (hash-ref* parent x:parent-key x:parent-key x:parent-key x:pointers-key)
|
|
|
|
|
(list (mhasheq 'type uint8
|
|
|
|
|
(list (mhasheq x:pointer-type-key uint8
|
|
|
|
|
x:val-key 10
|
|
|
|
|
x:parent-key parent)))
|
|
|
|
|
(check-equal? (get-output-bytes (current-output-port)) (bytes 5))))
|
|
|
|
@ -173,7 +173,7 @@ https://github.com/mbutterick/restructure/blob/master/test/Pointer.coffee
|
|
|
|
|
x:pointers-key null))
|
|
|
|
|
(encode (x:pointer uint8 'void) (x:void-pointer uint8 55) #:parent parent)
|
|
|
|
|
(check-equal? (hash-ref parent x:pointer-offset-key) 2)
|
|
|
|
|
(check-equal? (hash-ref parent x:pointers-key) (list (mhasheq 'type uint8 x:val-key 55 x:parent-key parent)))
|
|
|
|
|
(check-equal? (hash-ref parent x:pointers-key) (list (mhasheq x:pointer-type-key uint8 x:val-key 55 x:parent-key parent)))
|
|
|
|
|
(check-equal? (get-output-bytes (current-output-port)) (bytes 1))))
|
|
|
|
|
|
|
|
|
|
(test-case
|
|
|
|
|