From: Tomas Doran Date: Fri, 22 Jan 2010 22:22:23 +0000 (+0000) Subject: Clean tests up to test both top level and fragment uris in the same code and remove... X-Git-Tag: 0.000006_01~1^2~32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1ca374082b8102f1dffa54e33fe7610f95d804e5;p=catagits%2FGitalist.git Clean tests up to test both top level and fragment uris in the same code and remove duplicate tests --- diff --git a/t/01app.t b/t/01app.t index d41e889..e58506a 100644 --- a/t/01app.t +++ b/t/01app.t @@ -23,43 +23,35 @@ for my $p ('', qw{ my $response = request('/DoesNotExist'); is $response->code, 404, 'invalid repository 404s'; like $response->content, qr/Page not found/, 'invalid repository handled correctly'; -{ - # URI tests for repo1 - local *test = curry_test_uri('fragment/repo1'); - test(''); - test('shortlog'); - test('log'); - test('heads'); - test('tags'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree/dir1'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff/plain'); - #test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/shortlog/dir1'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/history/dir1'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blame/file1'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blob/file1'); + +# URI tests for repo1 +foreach my $test (map {curry_test_uri($_)} ('fragment/repo1', 'repo1') ) { + $test->(''); + $test->('shortlog'); + $test->('log'); + $test->('heads'); + $test->('tags'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree/dir1'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff/plain'); + #test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/shortlog/dir1'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/history/dir1'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blame/file1'); + $test->('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blob/file1'); } { # URI tests for repo1 local *test = curry_test_uri('repo1'); - test(''); test('search'); - test('shortlog'); - test('log'); test('reflog'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/tree'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/diff'); + test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patch'); test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/1'); test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/patches/2'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/history/dir1'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blame/file1'); test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/raw/file1'); - test('36c6c6708b8360d7023e8a1649c45bcf9b3bd818/blob/file1'); TODO: { local $TODO = "FIXME";