]> gitweb.factorcode.org Git - factor.git/blob - basis/checksums/openssl/openssl-tests.factor
Create basis vocab root
[factor.git] / basis / checksums / openssl / openssl-tests.factor
1 IN: checksums.openssl.tests
2 USING: byte-arrays checksums.openssl checksums tools.test
3 accessors kernel system ;
4
5 [
6     B{ 201 238 222 100 92 200 182 188 138 255 129 163 115 88 240 136 }
7 ]
8 [
9     "Hello world from the openssl binding" >byte-array
10     "md5" <openssl-checksum> checksum-bytes
11 ] unit-test
12
13 [
14   B{ 63 113 237 255 181 5 152 241 136 181 43 95 160 105 44 87 49 82 115 0 }
15 ]
16 [
17     "Hello world from the openssl binding" >byte-array
18     "sha1" <openssl-checksum> checksum-bytes
19 ] unit-test
20
21 [
22     "Bad checksum test" >byte-array
23     "no such checksum" <openssl-checksum>
24     checksum-bytes
25 ] [ [ unknown-digest? ] [ name>> "no such checksum" = ] bi and ]
26 must-fail-with
27
28 [ ] [ image openssl-sha1 checksum-file drop ] unit-test