test: update test expectations for unified report format

- Update E2E tests to expect "Clone Detection Analysis Report" instead of "Clone Detection Results"
- Update E2E tests to expect "Dead Code Analysis Report" instead of "Dead Code Detection Results"
- Update severity expectations from "CRITICAL" to "High" in dead code tests
- Update statistics label expectations in integration tests
- All tests now pass with the unified report format

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
DaisukeYoda
2025-09-11 00:26:15 +09:00
parent d055eb8483
commit 245e75788c
3 changed files with 15 additions and 15 deletions

View File

@@ -46,8 +46,8 @@ def func2():
output := stdout.String()
// Verify output contains expected clone detection results header
if !strings.Contains(output, "Clone Detection Results") {
t.Error("Output should contain 'Clone Detection Results' header")
if !strings.Contains(output, "Clone Detection Analysis Report") {
t.Error("Output should contain 'Clone Detection Analysis Report' header")
}
}
@@ -280,7 +280,7 @@ def low_similarity():
output := stdout.String()
// Just check that the command completed successfully with different thresholds
if !strings.Contains(output, "Clone Detection Results") {
if !strings.Contains(output, "Clone Detection Analysis Report") {
t.Error("Output should contain clone detection results header")
}
})
@@ -463,7 +463,7 @@ def another_func():
output := stdout.String()
// Should analyze the file successfully
if !strings.Contains(output, "Clone Detection Results") {
if !strings.Contains(output, "Clone Detection Analysis Report") {
t.Error("Output should contain clone detection results header")
}
}
@@ -557,7 +557,7 @@ def main_function():
output := stdout.String()
// Should complete successfully
if !strings.Contains(output, "Clone Detection Results") {
if !strings.Contains(output, "Clone Detection Analysis Report") {
t.Error("Should contain clone detection results header")
}
}

View File

@@ -61,13 +61,13 @@ def function_with_raise():
output := stdout.String()
// Verify output contains expected dead code findings
if !strings.Contains(output, "Dead Code Detection Results") {
t.Error("Output should contain 'Dead Code Detection Results' header")
if !strings.Contains(output, "Dead Code Analysis Report") {
t.Error("Output should contain 'Dead Code Analysis Report' header")
}
if !strings.Contains(output, "function_with_dead_code") {
t.Error("Output should contain 'function_with_dead_code'")
}
if !strings.Contains(output, "CRITICAL") {
if !strings.Contains(output, "High") {
t.Error("Output should contain critical severity findings")
}
if !strings.Contains(output, "unreachable") {
@@ -261,7 +261,7 @@ def warning_example(x):
}
output := stdout.String()
if !strings.Contains(output, "CRITICAL") {
if !strings.Contains(output, "High") {
t.Error("Output should contain critical severity findings")
}
@@ -282,7 +282,7 @@ def warning_example(x):
t.Error("Output should contain critical_example function")
}
// The output should contain some analysis results
if !strings.Contains(output2, "Files analyzed: 1") {
if !strings.Contains(output2, "Total Files: 1") {
t.Error("Output should show files were analyzed")
}
}
@@ -440,7 +440,7 @@ def function_with_context():
if !strings.Contains(output, "function_with_context") {
t.Error("Output should contain the function name")
}
if !strings.Contains(output, "CRITICAL") {
if !strings.Contains(output, "High") {
t.Error("Output should detect critical dead code")
}
// Context display might work differently than expected, so check for general structure

View File

@@ -74,7 +74,7 @@ func TestCloneDetectionIntegration(t *testing.T) {
assert.NotEmpty(t, output, "Should produce output")
// Basic output validation
assert.Contains(t, output, "Clone Detection Results", "Should contain results header")
assert.Contains(t, output, "Clone Detection Analysis Report", "Should contain results header")
}
// TestCloneUseCaseBuilder tests the builder pattern for creating use cases
@@ -211,9 +211,9 @@ func TestCloneOutputFormatterIntegration(t *testing.T) {
assert.NoError(t, err, "Should format as text without error")
textOutput := textBuffer.String()
assert.Contains(t, textOutput, "Clone Detection Results", "Should contain header")
assert.Contains(t, textOutput, "Files analyzed: 2", "Should contain statistics")
assert.Contains(t, textOutput, "Clone pairs found: 1", "Should contain pair count")
assert.Contains(t, textOutput, "Clone Detection Analysis Report", "Should contain header")
assert.Contains(t, textOutput, "Files Analyzed: 2", "Should contain statistics")
assert.Contains(t, textOutput, "Clone Pairs: 1", "Should contain pair count")
assert.Contains(t, textOutput, "Type-1", "Should contain clone type")
assert.Contains(t, textOutput, "similarity: 0.950", "Should contain similarity")