1 USING: base16 byte-arrays kernel sequences tools.test ;
3 { t } [ 256 <iota> >byte-array dup >base16 base16> = ] unit-test
5 { "00" } [ B{ 0 } >base16 "" like ] unit-test
6 { "01" } [ B{ 1 } >base16 "" like ] unit-test
7 { "0102" } [ B{ 1 2 } >base16 "" like ] unit-test
9 { B{ 0 } } [ "00" base16> ] unit-test
10 { B{ 1 } } [ "01" base16> ] unit-test
11 { B{ 1 2 } } [ "0102" base16> ] unit-test
13 [ "0" base16> ] [ malformed-base16? ] must-fail-with
14 [ "Z" base16> ] [ malformed-base16? ] must-fail-with