xml-options_ut.cpp 750 B

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