Changeset 38918 in project


Ignore:
Timestamp:
08/30/20 04:20:12 (4 weeks ago)
Author:
Kon Lovett
Message:

add pack-integer u8 test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/5/blob-utils/trunk/tests/blob-utils-test.scm

    r38412 r38918  
    3535(test-group "Pack Integer"
    3636  (let ((res (pack-u8 #x2d)))
    37     (test-assert (string? res))
    38     (test "byte set" (integer->char #x2d) (string-ref res 0)) )
    39   (let ((res (pack-integer #x0606 #:kind 'blob #:order 'little-endian)))
    40     (test-assert (blob? res))
     37    (test-assert "pack-u8" (string? res))
     38    (test "pack-u8 byte set" (integer->char #x2d) (string-ref res 0)) )
     39  (let ((res (pack-integer #x2d #:kind 'string)))
     40    (test-assert "pack-integer u8" (string? res))
     41    (test "pack-integer u8 byte set" (integer->char #x2d) (string-ref res 0)) )
     42  (let ((res (pack-integer #x0706 #:kind 'blob #:order 'little-endian)))
     43    (test-assert "pack-integer u16" (blob? res))
    4144    (let ((str (blob->string res)))
    42       (test "low byte set" (integer->char #x06) (string-ref str 0)) ) )
     45      (test "pack-integer u16 low byte set" (integer->char #x06) (string-ref str 0))
     46      (test "pack-integer u16 high byte set" (integer->char #x07) (string-ref str 1)) ) )
    4347)
    4448
Note: See TracChangeset for help on using the changeset viewer.