cgitsb/tests/t0106-diff.sh
John Keeping c95cc5ec56 tests: use Git's test framework
This allows tests to run in parallel as well as letting us use "prove"
or another TAP harness to run the tests.

Git's test framework requires Git to be fully built before letting any
tests run, so add a new target to the top-level Makefile which builds
all of Git instead of just libgit.a and make the "test" target depend on
that.

Signed-off-by: John Keeping <john@keeping.me.uk>
2013-04-08 22:27:11 +02:00

20 строки
546 B
Bash
Исполняемый файл

#!/bin/sh
test_description='Check content on diff page'
. ./setup.sh
test_expect_success 'generate foo/diff' 'cgit_url "foo/diff" >tmp'
test_expect_success 'find diff header' 'grep "a/file-5 b/file-5" tmp'
test_expect_success 'find blob link' 'grep "<a href=./foo/tree/file-5?id=" tmp'
test_expect_success 'find added file' 'grep "new file mode 100644" tmp'
test_expect_success 'find hunk header' '
grep "<div class=.hunk.>@@ -0,0 +1 @@</div>" tmp
'
test_expect_success 'find added line' '
grep "<div class=.add.>+5</div>" tmp
'
test_done