Skip to content

Commit 26eba5f

Browse files
committed
add test case for legacy hash
1 parent 54f8e10 commit 26eba5f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/unit/get_shortest_hash.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ cpm_get_shortest_hash(${tmp} "cccb77be9609d2768ed80dd42cec54f77b1f1456" hash)
5353
assert_equal(${hash} "cccb77be")
5454
assert_contents_equal(${tmp}/cccb77be.hash cccb77be9609d2768ed80dd42cec54f77b1f1456)
5555

56+
# check that legacy hashs are recognized
57+
file(MAKE_DIRECTORY "${tmp}/cccb77be9609d2768ed80dd42cec54f77b1f1457")
58+
cpm_get_shortest_hash(${tmp} "cccb77be9609d2768ed80dd42cec54f77b1f1457" hash)
59+
assert_equal(${hash} "cccb77be9609d2768ed80dd42cec54f77b1f1457")
60+
5661
# 1. The old file should still exist, and have the same content
5762
assert_contents_equal(${tmp}/cccb.hash cccb77ae9609d2768ed80dd42cec54f77b1f1455)
5863
assert_contents_equal(${tmp}/cccb77ae.hash cccb77ae9609d2768ed80dd42cec54f77b1f1456)

0 commit comments

Comments
 (0)