Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2018 CESNET, https://photonics.cesnet.cz/ |
| 3 | * Copyright (C) 2018 FIT CVUT, https://fit.cvut.cz/ |
| 4 | * |
| 5 | * Written by Václav Kubernát <kubervac@fit.cvut.cz> |
| 6 | * |
| 7 | */ |
| 8 | |
Jan Kundrát | a33cf08 | 2019-03-28 11:55:57 +0100 | [diff] [blame] | 9 | #include "trompeloeil_doctest.h" |
Jan Kundrát | 76b3ddc | 2019-07-03 10:31:27 +0200 | [diff] [blame] | 10 | #include <boost/core/demangle.hpp> |
Václav Kubernát | 24df80e | 2018-06-06 15:18:03 +0200 | [diff] [blame] | 11 | #include "ast_commands.hpp" |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame] | 12 | #include "parser.hpp" |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 13 | #include "static_schema.hpp" |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame] | 14 | |
Jan Kundrát | 76b3ddc | 2019-07-03 10:31:27 +0200 | [diff] [blame] | 15 | std::ostream& operator<<(std::ostream& s, const set_ cmd) |
| 16 | { |
| 17 | return s << "Command SET {path: " << pathToAbsoluteSchemaString(cmd.m_path) << ", type " << boost::core::demangle(cmd.m_data.type().name()) << ", data: " << leafDataToString(cmd.m_data) << "}"; |
| 18 | } |
| 19 | |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame] | 20 | TEST_CASE("leaf editing") |
| 21 | { |
Václav Kubernát | bddbb17 | 2018-06-13 16:27:39 +0200 | [diff] [blame] | 22 | auto schema = std::make_shared<StaticSchema>(); |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 23 | schema->addModule("mod"); |
Václav Kubernát | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 24 | schema->addModule("pizza-module"); |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 25 | schema->addContainer("", "mod:contA"); |
| 26 | schema->addLeaf("", "mod:leafString", yang::LeafDataTypes::String); |
| 27 | schema->addLeaf("", "mod:leafDecimal", yang::LeafDataTypes::Decimal); |
| 28 | schema->addLeaf("", "mod:leafBool", yang::LeafDataTypes::Bool); |
Ivona Oboňová | 88c78ca | 2019-07-02 18:40:07 +0200 | [diff] [blame] | 29 | schema->addLeaf("", "mod:leafInt8", yang::LeafDataTypes::Int8); |
| 30 | schema->addLeaf("", "mod:leafInt16", yang::LeafDataTypes::Int16); |
| 31 | schema->addLeaf("", "mod:leafInt32", yang::LeafDataTypes::Int32); |
| 32 | schema->addLeaf("", "mod:leafInt64", yang::LeafDataTypes::Int64); |
| 33 | schema->addLeaf("", "mod:leafUint8", yang::LeafDataTypes::Uint8); |
| 34 | schema->addLeaf("", "mod:leafUint16", yang::LeafDataTypes::Uint16); |
| 35 | schema->addLeaf("", "mod:leafUint32", yang::LeafDataTypes::Uint32); |
| 36 | schema->addLeaf("", "mod:leafUint64", yang::LeafDataTypes::Uint64); |
Václav Kubernát | ab53899 | 2019-03-06 15:30:50 +0100 | [diff] [blame] | 37 | schema->addLeaf("", "mod:leafBinary", yang::LeafDataTypes::Binary); |
Václav Kubernát | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 38 | schema->addIdentity(std::nullopt, ModuleValuePair{"mod", "food"}); |
| 39 | schema->addIdentity(std::nullopt, ModuleValuePair{"mod", "vehicle"}); |
| 40 | schema->addIdentity(ModuleValuePair{"mod", "food"}, ModuleValuePair{"mod", "pizza"}); |
| 41 | schema->addIdentity(ModuleValuePair{"mod", "food"}, ModuleValuePair{"mod", "spaghetti"}); |
| 42 | schema->addIdentity(ModuleValuePair{"mod", "pizza"}, ModuleValuePair{"pizza-module", "hawaii"}); |
| 43 | schema->addLeafIdentityRef("", "mod:foodIdentRef", ModuleValuePair{"mod", "food"}); |
| 44 | schema->addLeafIdentityRef("", "mod:pizzaIdentRef", ModuleValuePair{"mod", "pizza"}); |
| 45 | schema->addLeafIdentityRef("mod:contA", "mod:identInCont", ModuleValuePair{"mod", "pizza"}); |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 46 | schema->addLeafEnum("", "mod:leafEnum", {"lol", "data", "coze"}); |
| 47 | schema->addLeaf("mod:contA", "mod:leafInCont", yang::LeafDataTypes::String); |
| 48 | schema->addList("", "mod:list", {"number"}); |
| 49 | schema->addLeaf("mod:list", "mod:leafInList", yang::LeafDataTypes::String); |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame] | 50 | Parser parser(schema); |
| 51 | std::string input; |
| 52 | std::ostringstream errorStream; |
| 53 | |
| 54 | SECTION("valid input") |
| 55 | { |
| 56 | set_ expected; |
| 57 | |
Václav Kubernát | ab53899 | 2019-03-06 15:30:50 +0100 | [diff] [blame] | 58 | SECTION("set mod:leafString some_data") |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame] | 59 | { |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 60 | input = "set mod:leafString some_data"; |
Václav Kubernát | 2eaceb8 | 2018-10-08 19:56:30 +0200 | [diff] [blame] | 61 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafString")}); |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 62 | expected.m_data = std::string("some_data"); |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame] | 63 | } |
| 64 | |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 65 | SECTION("set mod:contA/leafInCont more_data") |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame] | 66 | { |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 67 | input = "set mod:contA/leafInCont more_data"; |
Václav Kubernát | 2eaceb8 | 2018-10-08 19:56:30 +0200 | [diff] [blame] | 68 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, container_("contA")}); |
| 69 | expected.m_path.m_nodes.push_back(dataNode_{leaf_("leafInCont")}); |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 70 | expected.m_data = std::string("more_data"); |
| 71 | } |
| 72 | |
Václav Kubernát | ab53899 | 2019-03-06 15:30:50 +0100 | [diff] [blame] | 73 | SECTION("set mod:list[number=1]/leafInList another_data") |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 74 | { |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 75 | input = "set mod:list[number=1]/leafInList another_data"; |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 76 | auto keys = std::map<std::string, std::string>{ |
| 77 | {"number", "1"}}; |
Václav Kubernát | 2eaceb8 | 2018-10-08 19:56:30 +0200 | [diff] [blame] | 78 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, listElement_("list", keys)}); |
| 79 | expected.m_path.m_nodes.push_back(dataNode_{leaf_("leafInList")}); |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 80 | expected.m_data = std::string("another_data"); |
| 81 | } |
| 82 | |
| 83 | SECTION("data types") |
| 84 | { |
| 85 | SECTION("string") |
| 86 | { |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 87 | input = "set mod:leafString somedata"; |
Václav Kubernát | 2eaceb8 | 2018-10-08 19:56:30 +0200 | [diff] [blame] | 88 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafString")}); |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 89 | expected.m_data = std::string("somedata"); |
| 90 | } |
| 91 | |
Ivona Oboňová | 88c78ca | 2019-07-02 18:40:07 +0200 | [diff] [blame] | 92 | SECTION("int8") |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 93 | { |
Ivona Oboňová | 88c78ca | 2019-07-02 18:40:07 +0200 | [diff] [blame] | 94 | input = "set mod:leafInt8 2"; |
| 95 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafInt8")}); |
| 96 | expected.m_data = int8_t{2}; |
| 97 | } |
| 98 | |
| 99 | SECTION("negative int8") |
| 100 | { |
| 101 | input = "set mod:leafInt8 -10"; |
| 102 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafInt8")}); |
| 103 | expected.m_data = int8_t{-10}; |
| 104 | } |
| 105 | |
| 106 | SECTION("uint8") |
| 107 | { |
| 108 | input = "set mod:leafUint8 2"; |
| 109 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafUint8")}); |
| 110 | expected.m_data = uint8_t{2}; |
| 111 | } |
| 112 | |
| 113 | SECTION("int16") |
| 114 | { |
| 115 | input = "set mod:leafInt16 30000"; |
| 116 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafInt16")}); |
| 117 | expected.m_data = int16_t{30'000}; |
| 118 | } |
| 119 | |
| 120 | SECTION("uint16") |
| 121 | { |
| 122 | input = "set mod:leafUint16 30000"; |
| 123 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafUint16")}); |
| 124 | expected.m_data = uint16_t{30'000}; |
| 125 | } |
| 126 | |
| 127 | SECTION("int32") |
| 128 | { |
| 129 | input = "set mod:leafInt32 30000"; |
| 130 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafInt32")}); |
| 131 | expected.m_data = int32_t{30'000}; |
| 132 | } |
| 133 | |
| 134 | SECTION("uint32") |
| 135 | { |
| 136 | input = "set mod:leafUint32 30000"; |
| 137 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafUint32")}); |
| 138 | expected.m_data = uint32_t{30'000}; |
| 139 | } |
| 140 | |
| 141 | SECTION("int32") |
| 142 | { |
| 143 | input = "set mod:leafInt32 30000"; |
| 144 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafInt32")}); |
| 145 | expected.m_data = int32_t{30'000}; |
| 146 | } |
| 147 | |
| 148 | SECTION("uint64") |
| 149 | { |
| 150 | input = "set mod:leafUint64 30000"; |
| 151 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafUint64")}); |
| 152 | expected.m_data = uint64_t{30'000}; |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | SECTION("decimal") |
| 156 | { |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 157 | input = "set mod:leafDecimal 3.14159"; |
Václav Kubernát | 2eaceb8 | 2018-10-08 19:56:30 +0200 | [diff] [blame] | 158 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafDecimal")}); |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 159 | expected.m_data = 3.14159; |
| 160 | } |
| 161 | |
| 162 | SECTION("enum") |
| 163 | { |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 164 | input = "set mod:leafEnum coze"; |
Václav Kubernát | 2eaceb8 | 2018-10-08 19:56:30 +0200 | [diff] [blame] | 165 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafEnum")}); |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 166 | expected.m_data = enum_("coze"); |
| 167 | } |
| 168 | |
| 169 | SECTION("bool") |
| 170 | { |
Václav Kubernát | 744f57f | 2018-06-29 22:46:26 +0200 | [diff] [blame] | 171 | input = "set mod:leafBool true"; |
Václav Kubernát | 2eaceb8 | 2018-10-08 19:56:30 +0200 | [diff] [blame] | 172 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafBool")}); |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 173 | expected.m_data = true; |
| 174 | } |
Václav Kubernát | ab53899 | 2019-03-06 15:30:50 +0100 | [diff] [blame] | 175 | |
| 176 | SECTION("binary") |
| 177 | { |
| 178 | SECTION("zero ending '='") |
| 179 | { |
| 180 | input = "set mod:leafBinary This/IsABase64EncodedSomething++/342431++"; |
| 181 | expected.m_data = binary_{"This/IsABase64EncodedSomething++/342431++"}; |
| 182 | } |
| 183 | |
| 184 | SECTION("one ending '='") |
| 185 | { |
| 186 | input = "set mod:leafBinary This/IsABase64EncodedSomething++/342431++="; |
| 187 | expected.m_data = binary_{"This/IsABase64EncodedSomething++/342431++="}; |
| 188 | } |
| 189 | |
| 190 | SECTION("two ending '='") |
| 191 | { |
| 192 | input = "set mod:leafBinary This/IsABase64EncodedSomething++/342431++=="; |
| 193 | expected.m_data = binary_{"This/IsABase64EncodedSomething++/342431++=="}; |
| 194 | } |
| 195 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("leafBinary")}); |
| 196 | } |
Václav Kubernát | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 197 | |
| 198 | SECTION("identityRef") |
| 199 | { |
| 200 | SECTION("foodIdentRef") |
| 201 | { |
| 202 | input = "set mod:foodIdentRef "; |
| 203 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("foodIdentRef")}); |
| 204 | |
| 205 | SECTION("food") |
| 206 | { |
| 207 | input += "food"; |
| 208 | expected.m_data = identityRef_("food"); |
| 209 | } |
| 210 | SECTION("mod:food") |
| 211 | { |
| 212 | input += "mod:food"; |
| 213 | expected.m_data = identityRef_("mod", "food"); |
| 214 | } |
| 215 | SECTION("pizza") |
| 216 | { |
| 217 | input += "pizza"; |
| 218 | expected.m_data = identityRef_("pizza"); |
| 219 | } |
| 220 | SECTION("mod:pizza") |
| 221 | { |
| 222 | input += "mod:pizza"; |
| 223 | expected.m_data = identityRef_("mod", "pizza"); |
| 224 | } |
| 225 | SECTION("pizza-module:hawaii") |
| 226 | { |
| 227 | input += "pizza-module:hawaii"; |
| 228 | expected.m_data = identityRef_("pizza-module", "hawaii"); |
| 229 | } |
| 230 | } |
| 231 | SECTION("pizzaIdentRef") |
| 232 | { |
| 233 | input = "set mod:pizzaIdentRef "; |
| 234 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, leaf_("pizzaIdentRef")}); |
| 235 | SECTION("pizza") |
| 236 | { |
| 237 | input += "pizza"; |
| 238 | expected.m_data = identityRef_("pizza"); |
| 239 | } |
| 240 | SECTION("mod:pizza") |
| 241 | { |
| 242 | input += "mod:pizza"; |
| 243 | expected.m_data = identityRef_("mod", "pizza"); |
| 244 | } |
| 245 | SECTION("pizza-module:hawaii") |
| 246 | { |
| 247 | input += "pizza-module:hawaii"; |
| 248 | expected.m_data = identityRef_("pizza-module", "hawaii"); |
| 249 | } |
| 250 | } |
| 251 | SECTION("mod:contA/identInCont") |
| 252 | { |
| 253 | input = "set mod:contA/identInCont "; |
| 254 | expected.m_path.m_nodes.push_back(dataNode_{module_{"mod"}, container_("contA")}); |
| 255 | expected.m_path.m_nodes.push_back(dataNode_(leaf_("identInCont"))); |
| 256 | SECTION("pizza") |
| 257 | { |
| 258 | input += "pizza"; |
| 259 | expected.m_data = identityRef_("pizza"); |
| 260 | } |
| 261 | SECTION("mod:pizza") |
| 262 | { |
| 263 | input += "mod:pizza"; |
| 264 | expected.m_data = identityRef_("mod", "pizza"); |
| 265 | } |
| 266 | SECTION("pizza-module:hawaii") |
| 267 | { |
| 268 | input += "pizza-module:hawaii"; |
| 269 | expected.m_data = identityRef_("pizza-module", "hawaii"); |
| 270 | } |
| 271 | } |
| 272 | } |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame] | 273 | } |
| 274 | |
| 275 | command_ command = parser.parseCommand(input, errorStream); |
| 276 | REQUIRE(command.type() == typeid(set_)); |
| 277 | REQUIRE(boost::get<set_>(command) == expected); |
| 278 | } |
| 279 | |
| 280 | SECTION("invalid input") |
| 281 | { |
| 282 | SECTION("missing space between a command and its arguments") |
| 283 | { |
| 284 | SECTION("setleaf some_data") |
| 285 | { |
| 286 | input = "setleaf some_data"; |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | SECTION("missing space between arguments") |
| 291 | { |
| 292 | SECTION("set leaflol") |
| 293 | { |
| 294 | input = "set leaflol"; |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | SECTION("non-leaf identifiers") |
| 299 | { |
| 300 | SECTION("set nonexistent blabla") |
| 301 | { |
| 302 | input = "set nonexistent blabla"; |
| 303 | } |
| 304 | |
| 305 | SECTION("set contA abde") |
| 306 | { |
| 307 | input = "set contA abde"; |
| 308 | } |
| 309 | } |
| 310 | |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 311 | SECTION("wrong types") |
| 312 | { |
| 313 | SECTION("set leafBool blabla") |
| 314 | { |
| 315 | input = "set leafBool blabla"; |
| 316 | } |
Ivona Oboňová | 88c78ca | 2019-07-02 18:40:07 +0200 | [diff] [blame] | 317 | SECTION("set leafUint8 blabla") |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 318 | { |
Ivona Oboňová | 88c78ca | 2019-07-02 18:40:07 +0200 | [diff] [blame] | 319 | input = "set leafUint8 blabla"; |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 320 | } |
Ivona Oboňová | 88c78ca | 2019-07-02 18:40:07 +0200 | [diff] [blame] | 321 | SECTION("set leafUint8 -5") |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 322 | { |
Ivona Oboňová | 88c78ca | 2019-07-02 18:40:07 +0200 | [diff] [blame] | 323 | input = "set leafUint8 -5"; |
| 324 | } |
| 325 | SECTION("set leafInt8 blabla") |
| 326 | { |
| 327 | input = "set leafInt8 blabla"; |
| 328 | } |
| 329 | SECTION("set leafInt8 130") |
| 330 | { |
| 331 | input = "set leafInt8 130"; |
| 332 | } |
| 333 | SECTION("set leafUint16 blabla") |
| 334 | { |
| 335 | input = "set leafUint16 blabla"; |
| 336 | } |
| 337 | SECTION("set leafInt16 blabla") |
| 338 | { |
| 339 | input = "set leafInt16 blabla"; |
| 340 | } |
| 341 | SECTION("set leafUint32 blabla") |
| 342 | { |
| 343 | input = "set leafUint32 blabla"; |
| 344 | } |
| 345 | SECTION("set leafInt32 blabla") |
| 346 | { |
| 347 | input = "set leafInt32 blabla"; |
| 348 | } |
| 349 | SECTION("set leafUint64 blabla") |
| 350 | { |
| 351 | input = "set leafUint64 blabla"; |
| 352 | } |
| 353 | SECTION("set leafInt64 blabla") |
| 354 | { |
| 355 | input = "set leafInt64 blabla"; |
Václav Kubernát | ebca255 | 2018-06-08 19:06:02 +0200 | [diff] [blame] | 356 | } |
| 357 | SECTION("set leafEnum blabla") |
| 358 | { |
| 359 | input = "set leafEnum blabla"; |
| 360 | } |
| 361 | } |
| 362 | |
Václav Kubernát | ab53899 | 2019-03-06 15:30:50 +0100 | [diff] [blame] | 363 | SECTION("wrong base64 strings") |
| 364 | { |
| 365 | SECTION("invalid character") |
| 366 | input = "set leafBinary dbahj-"; |
| 367 | SECTION("equal sign in the middle") |
| 368 | input = "set leafBinary db=ahj"; |
| 369 | } |
| 370 | |
Václav Kubernát | eeb3884 | 2019-03-20 19:46:05 +0100 | [diff] [blame] | 371 | SECTION("non-existing identity") |
| 372 | { |
| 373 | input = "set mod:foodIdentRef identityBLABLA"; |
| 374 | } |
| 375 | |
| 376 | SECTION("setting identities with wrong bases") |
| 377 | { |
| 378 | SECTION("set mod:foodIdentRef mod:vehicle") |
| 379 | { |
| 380 | input = "set mod:foodIdentRef mod:vehicle"; |
| 381 | } |
| 382 | SECTION("set mod:pizzaIdentRef mod:food") |
| 383 | { |
| 384 | input = "set mod:pizzaIdentRef mod:food"; |
| 385 | } |
| 386 | } |
| 387 | SECTION("setting different module identities without prefix") |
| 388 | { |
| 389 | input = "set mod:pizzaIdentRef hawaii"; |
| 390 | } |
| 391 | SECTION("identity prefix without name") |
| 392 | { |
| 393 | input = "set mod:contA/identInCont pizza-module:"; |
| 394 | } |
| 395 | |
Jan Kundrát | c381e63 | 2019-03-14 13:39:11 +0100 | [diff] [blame] | 396 | REQUIRE_THROWS_AS(parser.parseCommand(input, errorStream), InvalidCommandException); |
Václav Kubernát | 0720424 | 2018-06-04 18:12:09 +0200 | [diff] [blame] | 397 | } |
| 398 | } |