Add test cases
This commit is contained in:
parent
6e86e6494b
commit
0217e6736c
2 changed files with 22 additions and 0 deletions
|
@ -5,3 +5,4 @@ $LOAD_PATH.unshift(File.expand_path("ext"))
|
||||||
require 'digest/keccak'
|
require 'digest/keccak'
|
||||||
require File.expand_path('test/test_usage')
|
require File.expand_path('test/test_usage')
|
||||||
require File.expand_path('test/test_vectors')
|
require File.expand_path('test/test_vectors')
|
||||||
|
require File.expand_path('test/test_new')
|
||||||
|
|
21
test/test_new.rb
Normal file
21
test/test_new.rb
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'test/unit'
|
||||||
|
|
||||||
|
class KeccakNewTests < Test::Unit::TestCase
|
||||||
|
def test_singleton_method_hexdigest_256_empty
|
||||||
|
result = Digest::Keccak.hexdigest '', 256
|
||||||
|
assert_instance_of String, result
|
||||||
|
assert_equal 'c5d2460186f7233c927e7db2dcc703c0' \
|
||||||
|
'e500b653ca82273b7bfad8045d85a470',
|
||||||
|
result
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_singleton_method_hexdigest_256_sample
|
||||||
|
result = Digest::Keccak.hexdigest 'sample', 256
|
||||||
|
assert_instance_of String, result
|
||||||
|
assert_equal 'b80204f7e9243e4fca5489740ccd31dc' \
|
||||||
|
'd0a54619a7f4165cee73c191ef7271a1',
|
||||||
|
result
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue