21 #include <wibble/test.h>
24 #include <tagcoll/utils/set.h>
25 #include <tagcoll/input/stdio.h>
30 using namespace tagcoll::utils;
31 using namespace ept::debtags;
45 assert( tags().hasFacet(
"works-with" ) );
46 assert( !tags().hasFacet(
"blah" ) );
51 assert( tags().hasTag(
"works-with::people" ) );
52 assert( !tags().hasTag(
"works-with::midgets" ) );
57 const voc::TagData *people = tags().tagData(
"works-with::people" ),
58 *midgets = tags().tagData(
"works-with::midgets" ),
59 *blahg = tags().tagData(
"works-with::blahg" ),
60 *text = tags().tagData(
"works-with::text" ),
61 *people2 = tags().tagData(
"works-with::people" );
62 assert( people != midgets );
63 assert( people != text );
64 assert( people != blahg );
65 assert( midgets == blahg );
66 assert( midgets == midgets );
67 assert( people == people2 );
68 assert( people == people );
73 std::string a =
"works-with::people",
74 b =
"works-with::midgets";
75 std::set<std::string> s = tags().tags(),
76 f = tags().tags(
"works-with" ),
77 n = tags().tags(
"nonsense" );
78 assert( set_contains(s, a) );
79 assert( set_contains(f, a) );
80 assert( set_contains(s, f) );
81 assert( !set_contains(s, b) );
82 assert( !set_contains(f, b) );
90 assert_eq(f->
name,
"works-with");
92 const voc::TagData* t = tags().tagData(
"works-with::people" );
94 assert_eq(t->
name,
"works-with::people");
100 std::set<std::string> x = tags().
tags(
"works-with" );
101 assert( x == f->
tags() );
106 const voc::FacetData* f = tags().facetData(
"does-not-work-with" );
122 assert( tags().hasTag(
"implemented-in::c" ) );
128 std::set<std::string> facets = tags().facets();
130 for (std::set<std::string>::const_iterator i = facets.begin();
131 i != facets.end(); i++)
141 std::set<std::string> tags = this->tags().tags();
142 for (std::set<std::string>::const_iterator i = tags.begin();
143 i != tags.end(); i++)
157 assert_eq(first->
name,
string(
"accessibility::TODO"));
162 assert_eq(last->name,
string(
"x11::xserver"));
163 assert_eq(last->shortDescription(), string(
"X Server"));
205 std::set<std::string> t = tags().tags(
"accessibility");
206 assert_eq(t.size(), 10u);
208 t = tags().tags(
"works-with-format");
209 assert_eq(t.size(), 33u);
223 set<std::string> facets = empty.
facets();
224 assert_eq(facets.size(), 0u);
226 set<std::string> tags = empty.
tags();
227 assert_eq(tags.size(), 0u);