diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Test the features the suite never reached
Index sorting, the commit graph, the stats periods past a week, the hex dump of a binary file and a Lua filter's html_url_arg and html_include ran in no test.
Diffstat (limited to 'tests/t0104-tree.sh')
-rwxr-xr-xtests/t0104-tree.sh19
1 file changed, 19 insertions, 0 deletions
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh
index e92b2a2..b48c394 100755
--- a/tests/t0104-tree.sh
+++ b/tests/t0104-tree.sh
@@ -135,4 +135,23 @@ test_expect_success 'a long directory chain ends on a link' '
! grep " / </td>" tmp
'
+test_expect_success 'a binary file in the tree shows as a hex dump' '
+ test_create_repo repos/bin &&
+ (
+ cd repos/bin &&
+ printf "\\000\\001\\002bin" >blob.bin &&
+ git add blob.bin &&
+ git commit -m binary
+ ) &&
+ {
+ echo "virtual-root=/" &&
+ echo "cache-size=0" &&
+ echo "repo.url=bin" &&
+ echo "repo.path=$PWD/repos/bin/.git"
+ } >binrc &&
+ CGIT_CONFIG="$PWD/binrc" QUERY_STRING="url=bin/tree/blob.bin" cgit >tmp &&
+ grep "<table class=.bin-blob.>" tmp &&
+ grep "<td class=.right.>0000</td><td class=.hex.> 00 01 02 62 69 6e" tmp
+'
+
test_done