From: Pat Thoyts Date: Thu, 25 Feb 2010 11:08:15 +0000 (+0000) Subject: Test the path_filter function X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=6feae07351f4e2c22f139a511491220be05b6f8b;p=gitk Test the path_filter function Signed-off-by: Pat Thoyts --- diff --git a/tests/all.tcl b/tests/all.tcl new file mode 100644 index 0000000..63f567e --- /dev/null +++ b/tests/all.tcl @@ -0,0 +1,5 @@ +package require Tcl 8.4 +package require tcltest 2 +tcltest::configure -testdir [file dirname [info script]] +eval [linsert $argv 0 tcltest::configure] +tcltest::runAllTests diff --git a/tests/path_filter.test b/tests/path_filter.test new file mode 100644 index 0000000..3f9322c --- /dev/null +++ b/tests/path_filter.test @@ -0,0 +1,26 @@ +package require tcltest +namespace import -force tcltest::* + +# Load gitk as library for testing from the parent of the test directory +source [file join [file dirname [testsDirectory]] gitk] + + +set tests { + 1 "" gitk 0 + 2 . gitk 1 + 3 ./ gitk 1 + 4 po po/de.po 1 + 5 ./po po/de.po 1 + 6 po gitk 0 + 7 po a/b 0 + 8 a a/b/c 1 +} +foreach {id filter name result} $tests { + test path_filter-$id "path_filter $filter $name" -body { + path_filter $filter $name + } -result $result +} +unset tests + +::tcltest::cleanupTests +return \ No newline at end of file