Skip to content

Commit

Permalink
Don't compare unstable highlighting of Pygments, but only the file lo…
Browse files Browse the repository at this point in the history
…cations
  • Loading branch information
jansorg committed Feb 14, 2024
1 parent 879444e commit 045a0aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/example/bug-loc.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Bug is that file cache highlight isn't updated when when
# Bug is that file cache highlight isn't updated when
# it is already cached so it continues to refer to a line in the source'd file
# rather than file it was source'd from (here it is this file).
dirname=${BASH_SOURCE%/*} # equivalent to dirname($0)
Expand Down
16 changes: 15 additions & 1 deletion test/integration/test-bug-loc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,21 @@ debugged_script="$top_srcdir/test/example/bug-loc.sh"

if ( pygmentize --version || pygmentize -V ) 2>/dev/null 1>/dev/null ; then
run_debugger_opts="-B -q --no-init --highlight=light"
run_test_check $TEST_NAME $TEST_NAME $debugged_script
(cd $srcdir && run_debugger "$debugged_script" 2>&1 >"$TEST_FILE" </dev/null)

# We're removing highlighted lines because Pygments is often changing the highlighting
/usr/bin/grep -v -E "^[0-9]+:"$'\t' "$TEST_FILE" >"${TEST_FILTERED_FILE}"
/usr/bin/grep -v -E "^[0-9]+:"$'\t' "$RIGHT_FILE" >"${RIGHT_FILTERED_FILE}"

check_output "$TEST_FILTERED_FILE" "$RIGHT_FILTERED_FILE"
rc=$?
if ((0 == rc)) ; then
rm -f $TEST_FILTERED_FILE
rm -f $RIGHT_FILTERED_FILE
fi

# Return code tells testing mechanism whether passed or not.
exit $rc
else
exit 77
fi

0 comments on commit 045a0aa

Please sign in to comment.