Skip to content

Commit

Permalink
gitweb: Fix test of highlighting support in t9500
Browse files Browse the repository at this point in the history
The commit 7ce896b (Enable highlight executable path as a
configuration option, 2010-09-21) forgot to update t9500 test.

While at it, describe highlight test better.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jakub Narebski authored and Junio C Hamano committed Oct 13, 2010
1 parent c72781d commit ae5e97e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions t/t9500-gitweb-standalone-no-errors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -650,25 +650,26 @@ test_debug 'cat gitweb.log'
# ----------------------------------------------------------------------
# syntax highlighting

cat >>gitweb_config.perl <<\EOF
$feature{'highlight'}{'override'} = 1;
EOF

highlight --version >/dev/null 2>&1
if [ $? -eq 127 ]; then
say "Skipping syntax highlighting test, because 'highlight' was not found"
else
test_set_prereq HIGHLIGHT
cat >>gitweb_config.perl <<-\EOF
our $highlight_bin = "highlight";
$feature{'highlight'}{'override'} = 1;
EOF
fi

test_expect_success HIGHLIGHT \
'syntax highlighting (no highlight)' \
'syntax highlighting (no highlight, unknown syntax)' \
'git config gitweb.highlight yes &&
gitweb_run "p=.git;a=blob;f=file"'
test_debug 'cat gitweb.log'

test_expect_success HIGHLIGHT \
'syntax highlighting (highlighted)' \
'syntax highlighting (highlighted, shell script)' \
'git config gitweb.highlight yes &&
echo "#!/usr/bin/sh" > test.sh &&
git add test.sh &&
Expand Down

0 comments on commit ae5e97e

Please sign in to comment.