21 #include <wibble/test.h>
23 #include <tagcoll/utils/set.h>
24 #include <tagcoll/input/stdio.h>
31 #define testfile TEST_ENV_DIR "debtags/vocabulary"
46 assert( tags.
hasFacet(
"works-with" ) );
54 assert( tags.
hasTag(
"works-with::people" ) );
55 assert( !tags.
hasTag(
"works-with::midgets" ) );
63 *midgets = tags.
tagData(
"works-with::midgets" ),
64 *blahg = tags.
tagData(
"works-with::blahg" ),
65 *text = tags.
tagData(
"works-with::text" ),
66 *people2 = tags.
tagData(
"works-with::people" );
67 assert( people != midgets );
68 assert( people != text );
69 assert( people != blahg );
70 assert( midgets == blahg );
71 assert( midgets == midgets );
72 assert( people == people2 );
73 assert( people == people );
80 std::string a =
"works-with::people",
81 b =
"works-with::midgets";
82 std::set<std::string> s = tags.
tags(),
83 f = tags.
tags(
"works-with" ),
84 n = tags.
tags(
"nonsense" );
85 assert( set_contains(s, a) );
86 assert( set_contains(f, a) );
87 assert( set_contains(s, f) );
88 assert( !set_contains(s, b) );
89 assert( !set_contains(f, b) );
100 assert_eq(f->
name,
"works-with");
104 assert_eq(t->
name,
"works-with::people");
113 std::set<std::string> x = tags.
tags(
"works-with" );
114 assert( x == f->
tags() );
144 assert( tags.
hasTag(
"implemented-in::c" ) );
153 std::set<std::string> facets = tags.
facets();
155 for (std::set<std::string>::const_iterator i = facets.begin();
156 i != facets.end(); i++)
169 std::set<std::string> tags = voc.
tags();
170 for (std::set<std::string>::const_iterator i = tags.begin();
171 i != tags.end(); i++)
186 assert_eq(first->
name,
string(
"accessibility::TODO"));
191 assert_eq(last->name,
string(
"x11::xserver"));
192 assert_eq(last->shortDescription(), string(
"X Server"));
201 std::set<std::string> t = tags.
tags(
"accessibility");
202 assert_eq(t.size(), 10u);
204 t = tags.
tags(
"works-with-format");
205 assert_eq(t.size(), 33u);
211 EnvOverride eo(
"DEBTAGS_VOCABULARY",
"./empty/novocabularyhere");
216 set<std::string> facets = empty.
facets();
217 assert_eq(facets.size(), 0u);
219 set<std::string> tags = empty.
tags();
220 assert_eq(tags.size(), 0u);
Test _6()
Definition: vocabulary.test.h:93
Test _4()
Definition: vocabulary.test.h:58
Test _14()
Definition: vocabulary.test.h:195
Test _3()
Definition: vocabulary.test.h:50
Definition: packagerecord.test.h:22
Test _12()
Definition: vocabulary.test.h:163
Test _8()
Definition: vocabulary.test.h:117
Test _10()
Definition: vocabulary.test.h:138
Definition: vocabulary.test.h:34
#define testfile
Definition: vocabulary.test.h:31
Test _13()
Definition: vocabulary.test.h:179
Test _7()
Definition: vocabulary.test.h:107
Test _11()
Definition: vocabulary.test.h:147
Test _1()
Definition: vocabulary.test.h:36
Test _2()
Definition: vocabulary.test.h:42
Test _5()
Definition: vocabulary.test.h:76
Test _15()
Definition: vocabulary.test.h:209
Test _9()
Definition: vocabulary.test.h:126