Merge: lib/md5: nitunitize tests
[nit.git] / lib / md5 / tests / test_md5.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 module test_md5 is test
16
17 import md5
18
19 class TestMd5
20 test
21
22 fun test_md5 is test do
23 assert "".md5 == "d41d8cd98f00b204e9800998ecf8427e"
24 assert "a".md5 == "0cc175b9c0f1b6a831c399e269772661"
25 assert "abc".md5 == "900150983cd24fb0d6963f7d28e17f72"
26 assert "message digest".md5 == "f96b697d7cb7938d525a2f31aaf161d0"
27 assert "abcdefghijklmnopqrstuvwxyz".md5 == "c3fcd3d76192e4007dfb496cca67e13b"
28 assert "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".md5 == "d174ab98d277d9f5a5611c2c9f419d9f"
29 assert "12345678901234567890123456789012345678901234567890123456789012345678901234567890".md5 == "57edf4a22be3c955ac49da2e2107b67a"
30 end
31 end