]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/base64/base64-tests.factor
factor: add newlines to .factor files
[factor.git] / basis / base64 / base64-tests.factor
index e3ab35d250bdd69988135ee01a03c6a0e48a5480..ef7e809c8836689bd89f170d594793e760683d0a 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
@@ -45,3 +47,10 @@ sequences splitting strings tools.test ;
 
 { "01a-b_cd" } [ "\xd3V\xbeo\xf7\x1d" >urlsafe-base64 "" like ] unit-test
 { "\xd3V\xbeo\xf7\x1d" } [ "01a-b_cd" urlsafe-base64> "" like ] unit-test
+
+{ "eyJhIjoiYmNkIn0" }
+[ "{\"a\":\"bcd\"}" >urlsafe-base64-jwt >string ] unit-test
+
+{ "{\"a\":\"bcd\"}" }
+[ "{\"a\":\"bcd\"}" >urlsafe-base64-jwt urlsafe-base64> >string ] unit-test
+