aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/xml/document/xml-options_ut.cpp
blob: 9be16baf3d338ff2e7e921b63f245509b0cba1a3 (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());
    }
}