lib/md5: nitunitize tests
authorAlexandre Terrasa <alexandre@moz-code.org>
Tue, 15 May 2018 02:46:29 +0000 (22:46 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Tue, 15 May 2018 02:46:29 +0000 (22:46 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/md5/tests/test_md5.nit [new file with mode: 0644]
tests/sav/test_md5.res [deleted file]
tests/test_md5.nit [deleted file]

diff --git a/lib/md5/tests/test_md5.nit b/lib/md5/tests/test_md5.nit
new file mode 100644 (file)
index 0000000..b3d0e2e
--- /dev/null
@@ -0,0 +1,31 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module test_md5 is test
+
+import md5
+
+class TestMd5
+       test
+
+       fun test_md5 is test do
+               assert "".md5 == "d41d8cd98f00b204e9800998ecf8427e"
+               assert "a".md5 == "0cc175b9c0f1b6a831c399e269772661"
+               assert "abc".md5 == "900150983cd24fb0d6963f7d28e17f72"
+               assert "message digest".md5 == "f96b697d7cb7938d525a2f31aaf161d0"
+               assert "abcdefghijklmnopqrstuvwxyz".md5 == "c3fcd3d76192e4007dfb496cca67e13b"
+               assert "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".md5 == "d174ab98d277d9f5a5611c2c9f419d9f"
+               assert "12345678901234567890123456789012345678901234567890123456789012345678901234567890".md5 == "57edf4a22be3c955ac49da2e2107b67a"
+       end
+end
diff --git a/tests/sav/test_md5.res b/tests/sav/test_md5.res
deleted file mode 100644 (file)
index bb86bb6..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-d41d8cd98f00b204e9800998ecf8427e
-0cc175b9c0f1b6a831c399e269772661
-900150983cd24fb0d6963f7d28e17f72
-f96b697d7cb7938d525a2f31aaf161d0
-c3fcd3d76192e4007dfb496cca67e13b
-d174ab98d277d9f5a5611c2c9f419d9f
-57edf4a22be3c955ac49da2e2107b67a
diff --git a/tests/test_md5.nit b/tests/test_md5.nit
deleted file mode 100644 (file)
index 325e2df..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-# This file is part of NIT ( http://www.nitlanguage.org ).
-#
-# Copyright 2012 Alexis Laferrière <alexis.laf@xymus.net>
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-module test_md5
-
-import md5
-
-print "".md5 # d41d8cd98f00b204e9800998ecf8427e"
-print "a".md5 # 0cc175b9c0f1b6a831c399e269772661"
-print "abc".md5 # 900150983cd24fb0d6963f7d28e17f72"
-print "message digest".md5 # f96b697d7cb7938d525a2f31aaf161d0"
-print "abcdefghijklmnopqrstuvwxyz".md5 # c3fcd3d76192e4007dfb496cca67e13b"
-print "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".md5 # d174ab98d277d9f5a5611c2c9f419d9f"
-print "12345678901234567890123456789012345678901234567890123456789012345678901234567890".md5 # 57edf4a22be3c955ac49da2e2107b67a"