Lumiera
0.pre.03
»edit your freedom«
Lumiera API Documentation
Intro
Overview
Modules
+
Classes
Class List
Class Index
+
Class Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
+
Typedefs
a
b
d
e
f
h
i
l
o
p
r
s
t
v
y
Enumerations
Enumerator
+
Related Functions
_
b
c
e
f
h
i
k
m
n
o
p
q
s
t
u
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
s
t
u
w
z
Typedefs
Enumerations
Enumerator
+
Files
File List
+
File Members
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
+
Functions
b
c
d
e
f
h
i
j
l
m
n
o
p
q
r
s
t
u
Variables
Typedefs
Enumerations
Enumerator
+
Macros
a
c
d
e
g
i
k
l
m
n
o
p
r
s
t
v
Related Pages
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
query-text-test.cpp
Go to the documentation of this file.
1
/*
2
QueryText(Test) - verify syntactical query representation
3
4
Copyright (C)
5
2012, Hermann Vosseler <Ichthyostega@web.de>
6
7
**Lumiera** is free software; you can redistribute it and/or modify it
8
under the terms of the GNU General Public License as published by the
9
Free Software Foundation; either version 2 of the License, or (at your
10
option) any later version. See the file COPYING for further details.
11
12
* *****************************************************************/
13
20
#include "
lib/test/run.hpp
"
21
#include "
lib/query-util.hpp
"
22
#include "
lib/query-text.hpp
"
23
#include "
lib/util.hpp
"
24
25
#include <string>
26
//#include <map>
27
28
using
util::contains
;
29
using
util::isnil;
30
using
std::string;
31
32
namespace
lib
{
33
namespace
test
{
34
35
namespace
{
// test fixture...
36
37
}
//(End) test fixture
38
39
40
41
42
/***************************************************************************/
49
class
QueryText_test
:
public
Test
50
{
51
52
virtual
void
run (Arg)
53
{
54
emptyRepresentation();
55
build_from_string();
56
useHashValue();
57
}
58
59
60
void
emptyRepresentation ()
61
{
62
QueryText
noText;
63
64
CHECK (isnil (noText));
65
CHECK (isnil (
string
(noText)));
66
}
67
68
69
void
build_from_string ()
70
{
71
QueryText
eternal (
"beats(lumiera, duke_nukem_forever)."
);
72
CHECK (contains (
string
(eternal),
"lumiera"
));
73
CHECK (contains (
string
(eternal),
"beats"
));
74
CHECK (contains (
string
(eternal),
"duke_nukem_forever"
));
75
CHECK (eternal.hasAtom (
"lumiera"
));
76
}
77
78
79
void
useHashValue ()
80
{
81
QueryText
one
(
"one"
);
82
QueryText
two
(
"two"
);
83
84
CHECK (0 <
hash_value
(one));
85
CHECK (0 <
hash_value
(two));
86
CHECK (
hash_value
(one) !=
hash_value
(two));
87
}
88
89
90
};
91
92
93
95
LAUNCHER(
QueryText_test
,
"unit common"
);
96
97
}}
// namespace lib::test
query-util.hpp
Utilities to support working with predicate queries.
test
Definition:
run.hpp:40
query-text.hpp
A generic syntactical representation for all kinds of queries.
lib
Implementation namespace for support and library code.
Definition:
common-services.cpp:54
run.hpp
Simplistic test class runner.
util.hpp
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
lib::test::QueryText_test
Definition:
query-text-test.cpp:49
lib::hash_value
HashVal hash_value(QueryText const &entry)
support using queries in hashtables.
Definition:
query-text.cpp:52
lib::test::anonymous_namespace{builder-qualifier-support-test.cpp}::two
ExampleStrategy::Qualifier two(string additionalArg)
definition of another qualifier two(arg), accepting an additional argument
Definition:
builder-qualifier-support-test.cpp:80
lib::test::anonymous_namespace{builder-qualifier-support-test.cpp}::one
ExampleStrategy::Qualifier one()
definition of a qualifier one()
Definition:
builder-qualifier-support-test.cpp:70
lib::QueryText
Syntactical query representation.
Definition:
query-text.hpp:61
util::contains
bool contains(SEQ const &cont, typename SEQ::const_reference val)
shortcut for brute-force containment test in any sequential container
Definition:
util.hpp:255
library
query-text-test.cpp
Generated on Fri Dec 13 2024 05:05:34 for Lumiera by
1.8.13