diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-03-05 21:07:20 +0100 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-03-05 21:07:20 +0100 |
commit | 0c8d76e5813d74a22928113e18607359e6a39cfe (patch) | |
tree | 93341263926a58a9c54545e4ca56e3ce4abf879c | |
parent | 6335ba05a97962f6724ff7cc443fc62c2cf9b3fc (diff) | |
download | sbotools2-0c8d76e5813d74a22928113e18607359e6a39cfe.tar.xz |
Add testing of tag search. This closes #37.
-rwxr-xr-x | t/01-test.t | 16 |
1 files changed, 15 insertions, 1 deletions
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 |