commit 0c8d76e5813d74a22928113e18607359e6a39cfe
parent 6335ba05a97962f6724ff7cc443fc62c2cf9b3fc
Author: Andreas Guldstrand <andreas.guldstrand@gmail.com>
Date: Sat, 5 Mar 2016 21:07:20 +0100
Add testing of tag search. This closes #37.
Diffstat:
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git 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