aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/xml/document/xml-options_ut.cpp
diff options
context:
space:
mode:
authorDevtools Arcadia <arcadia-devtools@yandex-team.ru>2022-02-07 18:08:42 +0300
committerDevtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net>2022-02-07 18:08:42 +0300
commit1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch)
treee26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/xml/document/xml-options_ut.cpp
downloadydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
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());
+ }
+}