summaryrefslogtreecommitdiff
path: root/tests/test_parse.cpp
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-07-01 18:01:12 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-07-01 18:01:12 +0000
commit8f27f244d0a0525a43d7acd840d71e6ecbe9e046 (patch)
tree115c136660361a8a907629a8bbaf97525c683cce /tests/test_parse.cpp
parent841aefb1207e759de551d3cf4d46e77b54344eaa (diff)
parse_wnorm_attribute is no longer deprecated (it's part of W3C recommendations, after all)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@557 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test_parse.cpp')
-rw-r--r--tests/test_parse.cpp40
1 files changed, 28 insertions, 12 deletions
diff --git a/tests/test_parse.cpp b/tests/test_parse.cpp
index d8aabd3..7f52d09 100644
--- a/tests/test_parse.cpp
+++ b/tests/test_parse.cpp
@@ -424,25 +424,41 @@ TEST(parse_attribute_eol_wconv)
CHECK_STRING(doc.child(STR("node")).attribute(STR("id")).value(), STR(" val1 val2 val3 val4 "));
}
-TEST(parse_attribute_variations)
+TEST(parse_attribute_wnorm)
{
xml_document doc;
for (int eol = 0; eol < 2; ++eol)
for (int wconv = 0; wconv < 2; ++wconv)
- for (int escapes = 0; escapes < 2; ++escapes)
- {
- unsigned int flags = parse_minimal;
-
- flags |= (eol ? parse_eol : 0);
- flags |= (wconv ? parse_wconv_attribute : 0);
- flags |= (escapes ? parse_escapes : 0);
-
- CHECK(doc.load(STR("<node id='1'/>"), flags));
- CHECK_STRING(doc.child(STR("node")).attribute(STR("id")).value(), STR("1"));
- }
+ {
+ unsigned int flags = parse_minimal | parse_wnorm_attribute | (eol ? parse_eol : 0) | (wconv ? parse_wconv_attribute : 0);
+ CHECK(doc.load(STR("<node id=' \t\r\rval1 \rval2\r\nval3\nval4\r\r'/>"), flags));
+ CHECK_STRING(doc.child(STR("node")).attribute(STR("id")).value(), STR("val1 val2 val3 val4"));
+ }
}
+TEST(parse_attribute_variations)
+{
+ xml_document doc;
+
+ for (int wnorm = 0; wnorm < 2; ++wnorm)
+ for (int eol = 0; eol < 2; ++eol)
+ for (int wconv = 0; wconv < 2; ++wconv)
+ for (int escapes = 0; escapes < 2; ++escapes)
+ {
+ unsigned int flags = parse_minimal;
+
+ flags |= (wnorm ? parse_wnorm_attribute : 0);
+ flags |= (eol ? parse_eol : 0);
+ flags |= (wconv ? parse_wconv_attribute : 0);
+ flags |= (escapes ? parse_escapes : 0);
+
+ CHECK(doc.load(STR("<node id='1'/>"), flags));
+ CHECK_STRING(doc.child(STR("node")).attribute(STR("id")).value(), STR("1"));
+ }
+}
+
+
TEST(parse_attribute_error)
{
xml_document doc;