Skip to content

Commit f058514

Browse files
committed
test: Add missing hash-to-hash update test case
- Tests updating from one git hash to a newer tag's hash - Covers important scenario of hash-to-hash updates - Verifies hash format preservation and comment replacement - Ensures old hash and comments are properly removed
1 parent 8c0107a commit f058514

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

updater/tests/update-dependency-cmake.Tests.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,22 @@ Describe 'CMake Helper Functions' {
126126
$content | Should -Not -Match 'v0.9.1'
127127
}
128128

129+
It 'updates hash to newer hash preserving format' {
130+
$sourceFile = "$testDataDir/hash-dependency.cmake"
131+
$testFile = "$tempDir/test.cmake"
132+
Copy-Item $sourceFile $testFile
133+
134+
# Update to a newer tag that will be converted to hash (0.11.0 is known to exist)
135+
Update-CMakeFile $testFile 'sentry-native' '0.11.0'
136+
137+
$content = Get-Content $testFile -Raw
138+
# Should have new hash with tag comment
139+
$content | Should -Match 'GIT_TAG [a-f0-9]{40} # 0.11.0'
140+
# Should not have old hash or old comment
141+
$content | Should -Not -Match 'a64d5bd8ee130f2cda196b6fa7d9b65bfa6d32e2'
142+
$content | Should -Not -Match '# 0.9.1'
143+
}
144+
129145
It 'preserves file structure and other content' {
130146
$sourceFile = "$testDataDir/single-dependency.cmake"
131147
$testFile = "$tempDir/test.cmake"

0 commit comments

Comments
 (0)