]> gitweb.factorcode.org Git - factor.git/blob - extra/base16/base16-tests.factor
Fixes #2966
[factor.git] / extra / base16 / base16-tests.factor
1 USING: base16 byte-arrays kernel sequences tools.test ;
2
3 { t } [ 256 <iota> >byte-array dup >base16 base16> = ] unit-test
4
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
8
9 { B{ 0 } } [ "00" base16> ] unit-test
10 { B{ 1 } } [ "01" base16> ] unit-test
11 { B{ 1 2 } } [ "0102" base16> ] unit-test
12
13 [ "0" base16> ] [ malformed-base16? ] must-fail-with
14 [ "Z" base16> ] [ malformed-base16? ] must-fail-with