Skip to content

Commit 5608442

Browse files
ElleNajtclaude
andcommitted
Also strip trailing separator columns from normalization
The extra "|----|" column in org table separators also needs to be normalized out for cross-platform consistency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 78a7424 commit 5608442

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎tests/run_expect_tests.sh‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ get_emacs_args() {
9292
EOF
9393
}
9494

95-
# TODO figure out how to only get the named tests to revaluate
95+
# TODO[tGxXIHAUTs] figure out how to only get the named tests to revaluate
9696
# (if (null ${test_names_str:-nil})
9797
# (org-babel-execute-buffer)
9898
# (dolist (name ${test_names_str:-nil})
@@ -117,9 +117,10 @@ compare_test() {
117117
# Normalize function to remove platform-specific differences:
118118
# - Remove \r characters (carriage returns from macOS)
119119
# - Remove trailing empty columns like "| \r |" or "| |" from org tables
120+
# - Remove trailing separator columns like "|----|" from table header separators
120121
normalize_filter='with_entries(
121122
select(.value | type == "string" and (contains(".png") | not)) |
122-
.value |= (gsub("\\| \\\\r \\|$"; "|") | gsub("\\| \\|$"; "|") | gsub("\\\\r"; ""))
123+
.value |= (gsub("\\| \\\\r \\|$"; "|") | gsub("\\| \\|$"; "|") | gsub("\\|----\\|$"; "|") | gsub("\\\\r"; ""))
123124
)'
124125
staging_test=$(echo "$staging_results" | jq --arg name "$test_name" "fromjson | .[\$name] | $normalize_filter")
125126
golden_test=$(cat "golden/${test_name}.json" | jq "$normalize_filter")

0 commit comments

Comments
 (0)