From 8641d2a16cdfd0fafc817f9c4d980562ffe58217 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Tue, 20 Oct 2026 23:10:43 -0400 Subject: [PATCH] naming: list removed lines before added ones in the corpus diff A failure now reads as a diff does: the recorded line (-) and then the line the rebuild gives (+), and the message says which is which. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QWhMwdqJYQKQq8RCLSL1LT --- apps/solidcraft-cli/tests/naming_corpus.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/solidcraft-cli/tests/naming_corpus.rs b/apps/solidcraft-cli/tests/naming_corpus.rs index 59eb987d2..d5f95af72 100644 --- a/apps/solidcraft-cli/tests/naming_corpus.rs +++ b/apps/solidcraft-cli/tests/naming_corpus.rs @@ -344,12 +344,12 @@ fn diff(want: &str, got: &str, cap: usize) -> Vec { if i < a.len() && j < b.len() && a[i] == b[j] { i += 1; j += 1; - } else if j < b.len() && (i == a.len() || lcs[i][j + 1] >= lcs[i + 1][j]) { - out.push(format!("+ {}", b[j])); - j += 1; - } else { + } else if i < a.len() && (j == b.len() || lcs[i + 1][j] >= lcs[i][j + 1]) { out.push(format!("- {}", a[i])); i += 1; + } else { + out.push(format!("+ {}", b[j])); + j += 1; } } } @@ -427,7 +427,7 @@ fn corpus_designs_rebuild_with_the_same_names_and_references() { } assert!( problems.is_empty(), - "{} design(s) rebuild with other names than tests/naming records (if that is intended, record it with NAMING_CORPUS_BLESS=1 and say why in the pull request):\n{}", + "{} design(s) rebuild with other names than tests/naming records (if that is intended, record it with NAMING_CORPUS_BLESS=1 and say why in the pull request; - recorded, + now):\n{}", problems.len(), problems.join("\n") );