]> gitweb.factorcode.org Git - factor.git/commitdiff
base64/32/85: adding tests for all byte values.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 5 Apr 2019 20:38:00 +0000 (13:38 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 5 Apr 2019 20:38:00 +0000 (13:38 -0700)
basis/base64/base64-tests.factor
extra/base32/base32-tests.factor
extra/base85/base85-tests.factor

index e3ab35d250bdd69988135ee01a03c6a0e48a5480..8821f9654c05c952cbef019ff65094844848ecd1 100644 (file)
@@ -1,5 +1,7 @@
-USING: base64 io.encodings.ascii io.encodings.string kernel
-sequences splitting strings tools.test ;
+USING: base64 byte-arrays io.encodings.ascii io.encodings.string
+kernel sequences splitting strings tools.test ;
+
+{ t } [ 256 <iota> >byte-array dup >base64 base64> = ] unit-test
 
 { "abcdefghijklmnopqrstuvwxyz" } [ "abcdefghijklmnopqrstuvwxyz" ascii encode >base64 base64> ascii decode
 ] unit-test
index b44dc7b7515d823f634e98dab991ed2e9f6460a9..da311af0e3301d30b10b21b4b9c3277b51b5f649 100644 (file)
@@ -1,7 +1,9 @@
 ! Copyright (C) 2019 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 
-USING: base32 sequences tools.test ;
+USING: base32 byte-arrays kernel sequences tools.test ;
+
+{ t } [ 256 <iota> >byte-array dup >base32 base32> = ] unit-test
 
 { B{ } } [ f >base32 ] unit-test
 { B{ } } [ B{ } >base32 ] unit-test
index 4f1ebd6193245affb209eefece42b7a5f8b5b34c..24692819954f123205e42b9c880f28524071c1e3 100644 (file)
@@ -1,7 +1,6 @@
-USING: base85 kernel strings tools.test ;
+USING: base85 byte-arrays kernel sequences strings tools.test ;
 
-{ t } [ "Hello, world" dup >base85 base85> >string = ] unit-test
-{ t } [ "ready" dup >base85 base85> >string = ] unit-test
+{ t } [ 256 <iota> >byte-array dup >base85 base85> = ] unit-test
 
 { "NM!" } [ "He" >base85 >string ] unit-test
 { t } [ "He" dup >base85 base85> >string = ] unit-test