Skip to content

Commit

Permalink
Updating unit test names and adding comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaxmonsky committed Oct 15, 2024
1 parent 404ad88 commit d6c2296
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/test_hash_table.pf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@test
subroutine test_hash_table_add_get()
subroutine test_hash_table_add_hashable_char_value_same_after_get()
use funit
use hist_hash_table, only: hist_hash_table_t
use hist_hashable, only: hist_hashable_char_t
Expand All @@ -15,19 +15,21 @@ subroutine test_hash_table_add_get()
call htable%add_hash_key(hp)
hpout=>htable%table_value("1")

! Verify the key of the hashed value from the hashable is the same as the hashable that was passed in
@assertEqual("1", hpout%key())

end subroutine test_hash_table_add_get
end subroutine test_hash_table_add_hashable_char_value_same_after_get

@test
subroutine test_hash_table_get_key()
subroutine test_hash_table_key_has_is_expected()
use funit
use hist_hash_table, only: hist_hash_table_t

type(hist_hash_table_t) :: htable

call htable%initialize(4)

! Assert the key hash is consistent with expected implementation
@assertEqual(1, htable%key_hash("1"))

end subroutine test_hash_table_get_key
end subroutine test_hash_table_key_has_is_expected

0 comments on commit d6c2296

Please sign in to comment.