~autopilot/xpathselect/1.3

« back to all changes in this revision

Viewing changes to test/test_xpath_tree.cpp

  • Committer: Tarmac
  • Author(s): Christopher Lee, Thomi Richards
  • Date: 2013-04-25 09:42:38 UTC
  • mfrom: (33.1.6 parser-rejig)
  • Revision ID: tarmac-20130425094238-drswy0ypbnp6n389
Update parser to allow spaces in object names, spaces and periods in param values, and fix several other bugs in the parser. Fixes: https://bugs.launchpad.net/bugs/1150276.

Approved by Christopher Lee, Allan LeSage, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
    }
155
155
}
156
156
 
 
157
TEST_F(TestTreeFixture, test_mixed_query_property_match)
 
158
{
 
159
    leaf_1_->AddProperty("visible", "True");
 
160
    xpathselect::NodeList result = xpathselect::SelectNodes(root_, "/Root//Leaf[visible=True]");
 
161
 
 
162
    ASSERT_EQ(1, result.size());
 
163
    ASSERT_EQ(leaf_1_, result.front());
 
164
}
 
165
 
 
166
TEST_F(TestTreeFixture, test_search_node_with_wildcard_and_property)
 
167
{
 
168
    child_l1_->AddProperty("visible", "True");
 
169
    xpathselect::NodeList result = xpathselect::SelectNodes(root_, "/Root//*[visible=True]");
 
170
 
 
171
    ASSERT_EQ(1, result.size());
 
172
    ASSERT_EQ(child_l1_, result.front());
 
173
}
 
174
 
157
175
TEST_F(TestTreeFixture, test_wildcard)
158
176
{
159
177
    xpathselect::NodeList result = xpathselect::SelectNodes(root_, "/Root/*");