add empty string test

This commit is contained in:
David 2017-08-30 17:18:10 -04:00
parent 71058a05c1
commit 7bfe9c246a

View File

@ -19,6 +19,7 @@ class TestShamwow < Test::Unit::TestCase
end end
def test_sha2 def test_sha2
assert_equal(Digest::SHA2.hexdigest(''), sha2(""))
assert_equal(Digest::SHA2.hexdigest('abc'), sha2("abc")) assert_equal(Digest::SHA2.hexdigest('abc'), sha2("abc"))
assert_equal(Digest::SHA2.hexdigest("上一页"), sha2("上一页")) assert_equal(Digest::SHA2.hexdigest("上一页"), sha2("上一页"))
assert_equal(Digest::SHA2.hexdigest("😀"), sha2("😀")) assert_equal(Digest::SHA2.hexdigest("😀"), sha2("😀"))