aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/xml/document/xml-options_ut.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'library/cpp/xml/document/xml-options_ut.cpp')
-rw-r--r--library/cpp/xml/document/xml-options_ut.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/library/cpp/xml/document/xml-options_ut.cpp b/library/cpp/xml/document/xml-options_ut.cpp
new file mode 100644
index 0000000000..9be16baf3d
--- /dev/null
+++ b/library/cpp/xml/document/xml-options_ut.cpp
@@ -0,0 +1,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());
+ }
+}