blob: 63f2ed4f5944a8b69bf711f7e9c05a4c47da6d0f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
#include "xml-options.h"
#include <library/cpp/testing/unittest/registar.h>
Y_UNIT_TEST_SUITE(TestXmlOptions) {
Y_UNIT_TEST(SetHuge) {
NXml::TOptions opts;
opts.Set(NXml::EOption::Huge);
UNIT_ASSERT_EQUAL(XML_PARSE_HUGE, opts.GetMask());
}
Y_UNIT_TEST(VariadicContructor) {
NXml::TOptions opts(NXml::EOption::Huge, NXml::EOption::Compact, NXml::EOption::SAX1);
UNIT_ASSERT_EQUAL(XML_PARSE_HUGE | XML_PARSE_COMPACT | XML_PARSE_SAX1, opts.GetMask());
}
Y_UNIT_TEST(Chaining) {
NXml::TOptions opts;
opts
.Set(NXml::EOption::Huge)
.Set(NXml::EOption::Compact);
UNIT_ASSERT_EQUAL(XML_PARSE_HUGE | XML_PARSE_COMPACT, opts.GetMask());
}
}
|