#!/bin/sh -e

dump() {
    echo "$@" | keks.tcl | xxd -r -p
}

dump 'BIN ""' >bin-empty
dump 'BIN [binary decode hex "01020304"]' >bin-1234
dump 'STR ""' >str-empty
dump 'STR "foo"' >str-foo
dump 'TRUE' >true
dump 'FALSE' >false
dump 'NIL' >nil
dump 'INT 0' >int=0
dump 'INT -1' >int=-1
dump 'INT 10' >int=10
dump 'INT -10' >int=-10
dump 'INT 500' >int=500
dump 'INT -500' >int=-500
dump 'BLOB 2 ""' >blob-empty
dump 'BLOB 2 "f"' >blob-f
dump 'BLOB 2 "fo"' >blob-fo
dump 'BLOB 2 "foo"' >blob-foo
dump 'LIST {}' >list-empty
dump 'LIST {NIL}' >list-nil
dump 'LIST {TRUE FALSE}' >list-bool
dump 'MAP {}' >map-empty
dump 'MAP {a {LIST {NIL}}}' >map-foo
dump 'TAI64 [ToTAI [ISOToSec "1970-01-01 00:00:00"]]' >tai-utc0
dump 'TAI64 -1' >tai-before
dump 'RAW [binary decode hex "1840000000586846A4"]' >tai-leap
dump 'TAI64 1234 1234' >tai-ns
dump 'TAI64 1234 1234 1234' >tai-as
dump "MAGIC fuzz" >magic
dump "FLOAT nan" >float=nan
dump "FLOAT +inf" >float=+inf
dump "FLOAT -inf" >float=-inf
dump "FLOAT {0 0}" >float=0
dump "FLOAT {123 45}" >float=123,45
dump "FLOAT {-123 -45}" >float=-123,-45
