Skip to content

Commit 045a0aa

Browse files
committed
Don't compare unstable highlighting of Pygments, but only the file locations
1 parent 879444e commit 045a0aa

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

test/example/bug-loc.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# Bug is that file cache highlight isn't updated when when
2+
# Bug is that file cache highlight isn't updated when
33
# it is already cached so it continues to refer to a line in the source'd file
44
# rather than file it was source'd from (here it is this file).
55
dirname=${BASH_SOURCE%/*} # equivalent to dirname($0)

test/integration/test-bug-loc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,21 @@ debugged_script="$top_srcdir/test/example/bug-loc.sh"
1010

1111
if ( pygmentize --version || pygmentize -V ) 2>/dev/null 1>/dev/null ; then
1212
run_debugger_opts="-B -q --no-init --highlight=light"
13-
run_test_check $TEST_NAME $TEST_NAME $debugged_script
13+
(cd $srcdir && run_debugger "$debugged_script" 2>&1 >"$TEST_FILE" </dev/null)
14+
15+
# We're removing highlighted lines because Pygments is often changing the highlighting
16+
/usr/bin/grep -v -E "^[0-9]+:"$'\t' "$TEST_FILE" >"${TEST_FILTERED_FILE}"
17+
/usr/bin/grep -v -E "^[0-9]+:"$'\t' "$RIGHT_FILE" >"${RIGHT_FILTERED_FILE}"
18+
19+
check_output "$TEST_FILTERED_FILE" "$RIGHT_FILTERED_FILE"
20+
rc=$?
21+
if ((0 == rc)) ; then
22+
rm -f $TEST_FILTERED_FILE
23+
rm -f $RIGHT_FILTERED_FILE
24+
fi
25+
26+
# Return code tells testing mechanism whether passed or not.
27+
exit $rc
1428
else
1529
exit 77
1630
fi

0 commit comments

Comments
 (0)