From 0c8d76e5813d74a22928113e18607359e6a39cfe Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Sat, 5 Mar 2016 21:07:20 +0100 Subject: Add testing of tag search. This closes #37. --- t/01-test.t | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/t/01-test.t b/t/01-test.t index 2c30a2a..0c87ea0 100755 --- a/t/01-test.t +++ b/t/01-test.t @@ -422,7 +422,7 @@ sub { # 48: perform_search tests subtest 'perform_search tests', sub { - plan tests => 7; + plan tests => 9; my $findings = perform_search('desktop'); for my $found (@$findings) { @@ -443,6 +443,20 @@ sub { is($location, "$repo_path/$section/$name", 'perform_search good for $search eq desktop'); } + + # Test tag searching + my $tag_fn = "$repo_path/TAGS.txt"; + my ($tag_fh) = open_fh $tag_fn, '>'; + print {$tag_fh} <<'END'; +libdesktop-agnostic: testingtags +END + close $tag_fh; + + $findings = perform_search('testingtags'); + is ((scalar @$findings), 1, 'tag search works'); + is ($findings->[0]{name}, 'libdesktop-agnostic', 'and it returns the correct result.'); + + unlink $tag_fn; }; # 49: get_inst_names test -- cgit v1.2.3