Skip to content

Commit 1dc7bcd

Browse files
Ivan GorshkovIvan Gorshkov
authored andcommitted
test improvement
1 parent d7de42e commit 1dc7bcd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

integration/customcode_singletarget_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,20 @@ func testCustomCodeConflictResolutionAcceptOurs(t *testing.T, speakeasyBinary st
149149
customCodeOutput, customCodeErr := customCodeCmd.CombinedOutput()
150150
require.NoError(t, customCodeErr, "customcode command should succeed after conflict resolution: %s", string(customCodeOutput))
151151

152+
// Verify patch file was removed or is empty
153+
patchFile := filepath.Join(temp, ".speakeasy", "patches", "custom-code.diff")
154+
patchContent, err := os.ReadFile(patchFile)
155+
if err == nil {
156+
require.Empty(t, patchContent, "Patch file should be empty after accepting ours")
157+
}
158+
// If file doesn't exist, that's also fine
159+
160+
// Verify gen.lock doesn't contain customCodeCommitHash
161+
genLockPath := filepath.Join(temp, ".speakeasy", "gen.lock")
162+
genLockContent, err := os.ReadFile(genLockPath)
163+
require.NoError(t, err, "Failed to read gen.lock")
164+
require.NotContains(t, string(genLockContent), "customCodeCommitHash", "gen.lock should not contain customCodeCommitHash after accepting ours")
165+
152166
// Run speakeasy run again to verify patches are applied correctly
153167
runRegeneration(t, speakeasyBinary, temp, true)
154168

0 commit comments

Comments
 (0)