Skip to content

Commit b30c82b

Browse files
jhkim-piiclaude
andcommitted
Make diff_files/diff_files_sorted error on mismatch
Previously these functions returned 1 on mismatch but no caller checked the return value, allowing roundtrip failures to go undetected. Now they call error() so the sta process exits non-zero and the regression runner catches the failure. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
1 parent b6429ff commit b30c82b

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

test/helpers.tcl

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,10 @@ proc diff_files_sorted { file1 file2 } {
5656
} else {
5757
for {set i 0} {$i < [llength $lines1] && $i < [llength $lines2]} {incr i} {
5858
if { [lindex $lines1 $i] ne [lindex $lines2 $i] } {
59-
puts "Differences found (sorted)."
60-
puts "[lindex $lines1 $i]"
61-
puts "[lindex $lines2 $i]"
62-
return 1
59+
error "diff_files_sorted: $file1 vs $file2 differ at sorted line $i\n< [lindex $lines1 $i]\n> [lindex $lines2 $i]"
6360
}
6461
}
65-
puts "Differences found (sorted): file lengths differ."
66-
return 1
62+
error "diff_files_sorted: $file1 vs $file2 differ: file lengths differ"
6763
}
6864
}
6965

@@ -106,10 +102,7 @@ proc diff_files { file1 file2 { ignore "" } } {
106102
close $stream1
107103
close $stream2
108104
if { $found_diff || $line1_length != $line2_length } {
109-
puts "Differences found at line $line."
110-
puts "$line1"
111-
puts "$line2"
112-
return 1
105+
error "diff_files: $file1 vs $file2 differ at line $line\n< $line1\n> $line2"
113106
} else {
114107
puts "No differences found."
115108
return 0

0 commit comments

Comments
 (0)