aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-04-29 11:04:19 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-04-29 11:04:19 +0200
commit818bedc799073966a4c56fd83ab1df358b9e9c24 (patch)
tree5d69822c65b645e2ec57506c15b9dee0d188991b /tests
parent4e5dc8da6c8ef9ead4fcc6acbbade0cd6bfc61ca (diff)
Add value<T> version, analogous to attribute<T>
Diffstat (limited to 'tests')
-rw-r--r--tests/parser/driver.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/parser/driver.cxx b/tests/parser/driver.cxx
index b882188..c5d18f0 100644
--- a/tests/parser/driver.cxx
+++ b/tests/parser/driver.cxx
@@ -84,6 +84,17 @@ main ()
// cerr << e.what () << endl;
}
+ // Test value extraction.
+ //
+ {
+ istringstream is ("<root>123</root>");
+ parser p (is, "test");
+ p.next_expect (parser::start_element, "root");
+ p.next_expect (parser::characters);
+ assert (p.value<int> () == 123);
+ p.next_expect (parser::end_element);
+ }
+
// Test attribute maps.
//
{