blob: 939136bb1499acd3963c1d5434504ef9f78d7fba [file] [log] [blame]
James Feist481c5d52019-08-13 14:40:40 -07001#include "Utils.hpp"
2
3#include <boost/container/flat_map.hpp>
4#include <nlohmann/json.hpp>
James Feist8c505da2020-05-28 10:06:33 -07005
Brad Bishop9d2ef082020-08-26 15:17:55 -04006#include <regex>
7#include <string>
James Feist481c5d52019-08-13 14:40:40 -07008#include <variant>
9
10#include "gtest/gtest.h"
11
Brad Bishop9d2ef082020-08-26 15:17:55 -040012using namespace std::string_literals;
13
James Feist481c5d52019-08-13 14:40:40 -070014TEST(TemplateCharReplace, replaceOneInt)
15{
16 nlohmann::json j = {{"foo", "$bus"}};
17 auto it = j.begin();
18 boost::container::flat_map<std::string, BasicVariantType> data;
19 data["BUS"] = 23;
20
21 templateCharReplace(it, data, 0);
22
23 nlohmann::json expected = 23;
24 EXPECT_EQ(expected, j["foo"]);
25}
26
27TEST(TemplateCharReplace, replaceOneStr)
28{
29 nlohmann::json j = {{"foo", "$TEST"}};
30 auto it = j.begin();
31 boost::container::flat_map<std::string, BasicVariantType> data;
32 data["TEST"] = std::string("Test");
33
34 templateCharReplace(it, data, 0);
35
36 nlohmann::json expected = "Test";
37 EXPECT_EQ(expected, j["foo"]);
38}
39
40TEST(TemplateCharReplace, replaceSecondStr)
41{
42 nlohmann::json j = {{"foo", "the $TEST"}};
43 auto it = j.begin();
44 boost::container::flat_map<std::string, BasicVariantType> data;
45 data["TEST"] = std::string("Test");
46
47 templateCharReplace(it, data, 0);
48
49 nlohmann::json expected = "the Test";
50 EXPECT_EQ(expected, j["foo"]);
51}
52
James Feist481c5d52019-08-13 14:40:40 -070053TEST(TemplateCharReplace, replaceMiddleStr)
54{
55 nlohmann::json j = {{"foo", "the $TEST worked"}};
56 auto it = j.begin();
57 boost::container::flat_map<std::string, BasicVariantType> data;
58 data["TEST"] = std::string("Test");
59
60 templateCharReplace(it, data, 0);
61
62 nlohmann::json expected = "the Test worked";
63 EXPECT_EQ(expected, j["foo"]);
64}
James Feist481c5d52019-08-13 14:40:40 -070065
66TEST(TemplateCharReplace, replaceLastStr)
67{
68 nlohmann::json j = {{"foo", "the Test $TEST"}};
69 auto it = j.begin();
70 boost::container::flat_map<std::string, BasicVariantType> data;
71 data["TEST"] = 23;
72
73 templateCharReplace(it, data, 0);
74
75 nlohmann::json expected = "the Test 23";
76 EXPECT_EQ(expected, j["foo"]);
77}
78
79TEST(TemplateCharReplace, increment)
80{
81 nlohmann::json j = {{"foo", "3 plus 1 equals $TEST + 1"}};
82 auto it = j.begin();
83 boost::container::flat_map<std::string, BasicVariantType> data;
84 data["TEST"] = 3;
85
86 templateCharReplace(it, data, 0);
87
88 nlohmann::json expected = "3 plus 1 equals 4";
89 EXPECT_EQ(expected, j["foo"]);
90}
91
92TEST(TemplateCharReplace, decrement)
93{
94 nlohmann::json j = {{"foo", "3 minus 1 equals $TEST - 1 !"}};
95 auto it = j.begin();
96 boost::container::flat_map<std::string, BasicVariantType> data;
97 data["TEST"] = 3;
98
99 templateCharReplace(it, data, 0);
100
101 nlohmann::json expected = "3 minus 1 equals 2 !";
102 EXPECT_EQ(expected, j["foo"]);
103}
104
105TEST(TemplateCharReplace, modulus)
106{
107 nlohmann::json j = {{"foo", "3 mod 2 equals $TEST % 2"}};
108 auto it = j.begin();
109 boost::container::flat_map<std::string, BasicVariantType> data;
110 data["TEST"] = 3;
111
112 templateCharReplace(it, data, 0);
113
114 nlohmann::json expected = "3 mod 2 equals 1";
115 EXPECT_EQ(expected, j["foo"]);
116}
117
118TEST(TemplateCharReplace, multiply)
119{
120 nlohmann::json j = {{"foo", "3 * 2 equals $TEST * 2"}};
121 auto it = j.begin();
122 boost::container::flat_map<std::string, BasicVariantType> data;
123 data["TEST"] = 3;
124
125 templateCharReplace(it, data, 0);
126
127 nlohmann::json expected = "3 * 2 equals 6";
128 EXPECT_EQ(expected, j["foo"]);
129}
130
131TEST(TemplateCharReplace, divide)
132{
133 nlohmann::json j = {{"foo", "4 / 2 equals $TEST / 2"}};
134 auto it = j.begin();
135 boost::container::flat_map<std::string, BasicVariantType> data;
136 data["TEST"] = 4;
137
138 templateCharReplace(it, data, 0);
139
140 nlohmann::json expected = "4 / 2 equals 2";
141 EXPECT_EQ(expected, j["foo"]);
James Feist8c20feb2019-08-14 15:10:11 -0700142}
143
144TEST(TemplateCharReplace, multiMath)
145{
146 nlohmann::json j = {{"foo", "4 * 2 % 6 equals $TEST * 2 % 6"}};
147 auto it = j.begin();
148 boost::container::flat_map<std::string, BasicVariantType> data;
149 data["TEST"] = 4;
150
151 templateCharReplace(it, data, 0);
152
153 nlohmann::json expected = "4 * 2 % 6 equals 2";
154 EXPECT_EQ(expected, j["foo"]);
155}
156
157TEST(TemplateCharReplace, twoReplacements)
158{
159 nlohmann::json j = {{"foo", "$FOO $BAR"}};
160 auto it = j.begin();
161 boost::container::flat_map<std::string, BasicVariantType> data;
162 data["FOO"] = std::string("foo");
163 data["BAR"] = std::string("bar");
164
165 templateCharReplace(it, data, 0);
166
167 nlohmann::json expected = "foo bar";
168 EXPECT_EQ(expected, j["foo"]);
169}
170
171TEST(TemplateCharReplace, twoReplacementsWithMath)
172{
173 nlohmann::json j = {{"foo", "4 / 2 equals $TEST / 2 $BAR"}};
174 auto it = j.begin();
175 boost::container::flat_map<std::string, BasicVariantType> data;
176 data["TEST"] = 4;
177 data["BAR"] = std::string("bar");
178
179 templateCharReplace(it, data, 0);
180
181 nlohmann::json expected = "4 / 2 equals 2 bar";
182 EXPECT_EQ(expected, j["foo"]);
James Feistb0097d42019-08-15 09:24:13 -0700183}
184
185TEST(TemplateCharReplace, hexAndWrongCase)
186{
187 nlohmann::json j = {{"Address", "0x54"},
188 {"Bus", 15},
189 {"Name", "$bus sensor 0"},
190 {"Type", "SomeType"}};
191
192 boost::container::flat_map<std::string, BasicVariantType> data;
193 data["BUS"] = 15;
194
195 for (auto it = j.begin(); it != j.end(); it++)
196 {
197 templateCharReplace(it, data, 0);
198 }
199 nlohmann::json expected = {{"Address", 84},
200 {"Bus", 15},
201 {"Name", "15 sensor 0"},
202 {"Type", "SomeType"}};
203 EXPECT_EQ(expected, j);
204}
205
206TEST(TemplateCharReplace, replaceSecondAsInt)
207{
208 nlohmann::json j = {{"foo", "twelve is $TEST"}};
209 auto it = j.begin();
210 boost::container::flat_map<std::string, BasicVariantType> data;
211 data["test"] = 12;
212
213 templateCharReplace(it, data, 0);
214
215 nlohmann::json expected = "twelve is 12";
216 EXPECT_EQ(expected, j["foo"]);
217}
James Feistc296c802019-08-28 09:26:47 -0700218
219TEST(TemplateCharReplace, singleHex)
220{
221 nlohmann::json j = {{"foo", "0x54"}};
222 auto it = j.begin();
223 boost::container::flat_map<std::string, BasicVariantType> data;
224
225 templateCharReplace(it, data, 0);
226
227 nlohmann::json expected = 84;
228 EXPECT_EQ(expected, j["foo"]);
229}
Brad Bishop9d2ef082020-08-26 15:17:55 -0400230
231TEST(MatchProbe, stringEqString)
232{
233 nlohmann::json j = R"("foo")"_json;
234 BasicVariantType v = "foo"s;
235 EXPECT_TRUE(matchProbe(j, v));
236}
237
238TEST(MatchProbe, stringRegexEqString)
239{
240 nlohmann::json j = R"("foo*")"_json;
241 BasicVariantType v = "foobar"s;
242 EXPECT_TRUE(matchProbe(j, v));
243}
244
245TEST(MatchProbe, stringNeqString)
246{
247 nlohmann::json j = R"("foobar")"_json;
248 BasicVariantType v = "foo"s;
249 EXPECT_FALSE(matchProbe(j, v));
250}
251
252TEST(MatchProbe, stringRegexError)
253{
254 nlohmann::json j = R"("foo[")"_json;
255 BasicVariantType v = "foobar"s;
256 EXPECT_THROW(matchProbe(j, v), std::regex_error);
257}
258
259TEST(MatchProbe, stringZeroEqFalse)
260{
261 nlohmann::json j = R"("0")"_json;
262 BasicVariantType v = false;
263 EXPECT_TRUE(matchProbe(j, v));
264}
265
266TEST(MatchProbe, stringOneEqTrue)
267{
268 nlohmann::json j = R"("1")"_json;
269 BasicVariantType v = true;
270 EXPECT_TRUE(matchProbe(j, v));
271}
272
273TEST(MatchProbe, stringElevenNeqTrue)
274{
275 nlohmann::json j = R"("11")"_json;
276 BasicVariantType v = true;
277 EXPECT_FALSE(matchProbe(j, v));
278}
279
280TEST(MatchProbe, stringFalseNeqFalse)
281{
282 nlohmann::json j = R"("false")"_json;
283 BasicVariantType v = false;
284 EXPECT_FALSE(matchProbe(j, v));
285}
286
287TEST(MatchProbe, stringTrueNeqTrue)
288{
289 nlohmann::json j = R"("true")"_json;
290 BasicVariantType v = true;
291 EXPECT_FALSE(matchProbe(j, v));
292}
293
294TEST(MatchProbe, stringFalseNeqTrue)
295{
296 nlohmann::json j = R"("false")"_json;
297 BasicVariantType v = true;
298 EXPECT_FALSE(matchProbe(j, v));
299}
300
301TEST(MatchProbe, stringEqUint8)
302{
303 nlohmann::json j = R"("255")"_json;
304 BasicVariantType v = uint8_t(255);
305 EXPECT_TRUE(matchProbe(j, v));
306}
307
308TEST(MatchProbe, stringNeqUint8Overflow)
309{
310 nlohmann::json j = R"("65535")"_json;
311 BasicVariantType v = uint8_t(255);
312 EXPECT_FALSE(matchProbe(j, v));
313}
314
315TEST(MatchProbe, stringFalseNeqUint8Zero)
316{
317 nlohmann::json j = R"("false")"_json;
318 BasicVariantType v = uint8_t(0);
319 EXPECT_FALSE(matchProbe(j, v));
320}
321
322TEST(MatchProbe, stringTrueNeqUint8Zero)
323{
324 nlohmann::json j = R"("true")"_json;
325 BasicVariantType v = uint8_t(1);
326 EXPECT_FALSE(matchProbe(j, v));
327}
328
329TEST(MatchProbe, stringEqUint32)
330{
331 nlohmann::json j = R"("11")"_json;
332 BasicVariantType v = uint32_t(11);
333 EXPECT_TRUE(matchProbe(j, v));
334}
335
336TEST(MatchProbe, stringNeqUint32)
337{
338 nlohmann::json j = R"("12")"_json;
339 BasicVariantType v = uint32_t(11);
340 EXPECT_FALSE(matchProbe(j, v));
341}
342
343TEST(MatchProbe, stringEqInt32)
344{
345 nlohmann::json j = R"("-11")"_json;
346 BasicVariantType v = int32_t(-11);
347 EXPECT_TRUE(matchProbe(j, v));
348}
349
350TEST(MatchProbe, stringNeqInt32)
351{
352 nlohmann::json j = R"("-12")"_json;
353 BasicVariantType v = int32_t(-11);
354 EXPECT_FALSE(matchProbe(j, v));
355}
356
357TEST(MatchProbe, stringRegexEqInt32)
358{
359 nlohmann::json j = R"("1*4")"_json;
360 BasicVariantType v = int32_t(124);
361 EXPECT_TRUE(matchProbe(j, v));
362}
363
364TEST(MatchProbe, stringNeqUint64)
365{
366 nlohmann::json j = R"("foo")"_json;
367 BasicVariantType v = uint64_t(65535);
368 EXPECT_FALSE(matchProbe(j, v));
369}
370
371TEST(MatchProbe, stringEqDouble)
372{
373 nlohmann::json j = R"("123.4")"_json;
374 BasicVariantType v = double(123.4);
375 EXPECT_TRUE(matchProbe(j, v));
376}
377
378TEST(MatchProbe, stringNeqDouble)
379{
380 nlohmann::json j = R"("-123.4")"_json;
381 BasicVariantType v = double(123.4);
382 EXPECT_FALSE(matchProbe(j, v));
383}
384
385TEST(MatchProbe, stringNeqEmpty)
386{
387 nlohmann::json j = R"("-123.4")"_json;
388 BasicVariantType v;
389 EXPECT_FALSE(matchProbe(j, v));
390}
Brad Bishopc5eba592020-08-28 10:38:24 -0400391
392TEST(MatchProbe, boolStringError)
393{
394 nlohmann::json j = R"(false)"_json;
395 BasicVariantType v = "false"s;
396 EXPECT_THROW(matchProbe(j, v), std::invalid_argument);
397}
398
399TEST(MatchProbe, trueEqTrue)
400{
401 nlohmann::json j = R"(true)"_json;
402 BasicVariantType v = true;
403 EXPECT_TRUE(matchProbe(j, v));
404}
405
406TEST(MatchProbe, falseEqFalse)
407{
408 nlohmann::json j = R"(false)"_json;
409 BasicVariantType v = false;
410 EXPECT_TRUE(matchProbe(j, v));
411}
412
413TEST(MatchProbe, trueNeqFalse)
414{
415 nlohmann::json j = R"(true)"_json;
416 BasicVariantType v = false;
417 EXPECT_FALSE(matchProbe(j, v));
418}
419
420TEST(MatchProbe, trueNeqInt32Zero)
421{
422 nlohmann::json j = R"(true)"_json;
423 BasicVariantType v = int32_t(0);
424 EXPECT_FALSE(matchProbe(j, v));
425}
426
427TEST(MatchProbe, trueNeqInt32NegativeOne)
428{
429 nlohmann::json j = R"(true)"_json;
430 BasicVariantType v = int32_t(-1);
431 EXPECT_FALSE(matchProbe(j, v));
432}
433
434TEST(MatchProbe, falseNeqUint32One)
435{
436 nlohmann::json j = R"(false)"_json;
437 BasicVariantType v = uint32_t(1);
438 EXPECT_FALSE(matchProbe(j, v));
439}
440
441TEST(MatchProbe, falseEqUint32Zero)
442{
443 nlohmann::json j = R"(false)"_json;
444 BasicVariantType v = uint32_t(0);
445 EXPECT_TRUE(matchProbe(j, v));
446}
447
448TEST(MatchProbe, trueNeqDoubleNegativeOne)
449{
450 nlohmann::json j = R"(true)"_json;
451 BasicVariantType v = double(-1.1);
452 EXPECT_FALSE(matchProbe(j, v));
453}
454
455TEST(MatchProbe, trueEqDoubleOne)
456{
457 nlohmann::json j = R"(true)"_json;
458 BasicVariantType v = double(1.0);
459 EXPECT_TRUE(matchProbe(j, v));
460}
461
462TEST(MatchProbe, falseNeqDoubleOne)
463{
464 nlohmann::json j = R"(false)"_json;
465 BasicVariantType v = double(1.0);
466 EXPECT_FALSE(matchProbe(j, v));
467}
468
469TEST(MatchProbe, falseEqDoubleZero)
470{
471 nlohmann::json j = R"(false)"_json;
472 BasicVariantType v = double(0.0);
473 EXPECT_TRUE(matchProbe(j, v));
474}
475
476TEST(MatchProbe, falseEmptyError)
477{
478 nlohmann::json j = R"(false)"_json;
479 BasicVariantType v;
480 EXPECT_THROW(matchProbe(j, v), std::invalid_argument);
481}
482
483TEST(MatchProbe, trueEmptyError)
484{
485 nlohmann::json j = R"(true)"_json;
486 BasicVariantType v;
487 EXPECT_THROW(matchProbe(j, v), std::invalid_argument);
488}
Brad Bishopc2af5312020-08-28 10:39:49 -0400489
490TEST(MatchProbe, uintStringError)
491{
492 nlohmann::json j = R"(11)"_json;
493 BasicVariantType v = "11"s;
494 EXPECT_THROW(matchProbe(j, v), std::invalid_argument);
495}
496
497TEST(MatchProbe, uintEqTrue)
498{
499 nlohmann::json j = R"(1)"_json;
500 BasicVariantType v = true;
501 EXPECT_TRUE(matchProbe(j, v));
502}
503
504TEST(MatchProbe, uintEqFalse)
505{
506 nlohmann::json j = R"(0)"_json;
507 BasicVariantType v = false;
508 EXPECT_TRUE(matchProbe(j, v));
509}
510
511TEST(MatchProbe, uintNeqTrue)
512{
513 nlohmann::json j = R"(11)"_json;
514 BasicVariantType v = true;
515 EXPECT_FALSE(matchProbe(j, v));
516}
517
518TEST(MatchProbe, uintEqUint8)
519{
520 nlohmann::json j = R"(11)"_json;
521 BasicVariantType v = uint8_t(11);
522 EXPECT_TRUE(matchProbe(j, v));
523}
524
525TEST(MatchProbe, uintNeqUint8)
526{
527 nlohmann::json j = R"(11)"_json;
528 BasicVariantType v = uint8_t(12);
529 EXPECT_FALSE(matchProbe(j, v));
530}
531
532TEST(MatchProbe, uintNeqUint8Overflow)
533{
534 nlohmann::json j = R"(65535)"_json;
535 BasicVariantType v = uint8_t(255);
536 EXPECT_FALSE(matchProbe(j, v));
537}
538
539TEST(MatchProbe, uintEqInt8)
540{
541 nlohmann::json j = R"(11)"_json;
542 BasicVariantType v = int8_t(11);
543 EXPECT_TRUE(matchProbe(j, v));
544}
545
546TEST(MatchProbe, uintEqDouble)
547{
548 nlohmann::json j = R"(11)"_json;
549 BasicVariantType v = double(11.0);
550 EXPECT_TRUE(matchProbe(j, v));
551}
552
553TEST(MatchProbe, uintEqDoubleRound)
554{
555 nlohmann::json j = R"(11)"_json;
556 BasicVariantType v = double(11.7);
557 EXPECT_TRUE(matchProbe(j, v));
558}
559
560TEST(MatchProbe, uintEmptyError)
561{
562 nlohmann::json j = R"(11)"_json;
563 BasicVariantType v;
564 EXPECT_THROW(matchProbe(j, v), std::invalid_argument);
565}
Brad Bishop667e0502020-08-28 10:41:40 -0400566
567TEST(MatchProbe, intStringError)
568{
569 nlohmann::json j = R"(-11)"_json;
570 BasicVariantType v = "-11"s;
571 EXPECT_THROW(matchProbe(j, v), std::invalid_argument);
572}
573
574TEST(MatchProbe, intNeqTrue)
575{
576 nlohmann::json j = R"(-1)"_json;
577 BasicVariantType v = true;
578 EXPECT_FALSE(matchProbe(j, v));
579}
580
581TEST(MatchProbe, intNeqUint8)
582{
583 nlohmann::json j = R"(-11)"_json;
584 BasicVariantType v = uint8_t(11);
585 EXPECT_FALSE(matchProbe(j, v));
586}
587
588TEST(MatchProbe, intEqInt8)
589{
590 nlohmann::json j = R"(-11)"_json;
591 BasicVariantType v = int8_t(-11);
592 EXPECT_TRUE(matchProbe(j, v));
593}
594
595TEST(MatchProbe, intNeqDouble)
596{
597 nlohmann::json j = R"(-124)"_json;
598 BasicVariantType v = double(-123.0);
599 EXPECT_FALSE(matchProbe(j, v));
600}
601
602TEST(MatchProbe, intEqDouble)
603{
604 nlohmann::json j = R"(-11)"_json;
605 BasicVariantType v = double(-11.0);
606 EXPECT_TRUE(matchProbe(j, v));
607}
608
609TEST(MatchProbe, intEqDoubleRound)
610{
611 nlohmann::json j = R"(-11)"_json;
612 BasicVariantType v = double(-11.7);
613 EXPECT_TRUE(matchProbe(j, v));
614}
615
616TEST(MatchProbe, intEmptyError)
617{
618 nlohmann::json j = R"(-11)"_json;
619 BasicVariantType v;
620 EXPECT_THROW(matchProbe(j, v), std::invalid_argument);
621}
Brad Bishop3bd8e8d2020-08-28 10:42:27 -0400622
623TEST(MatchProbe, doubleStringError)
624{
625 nlohmann::json j = R"(0.0)"_json;
626 BasicVariantType v = "0.0"s;
627 EXPECT_THROW(matchProbe(j, v), std::invalid_argument);
628}
629
630TEST(MatchProbe, doubleEqFalse)
631{
632 nlohmann::json j = R"(0.0)"_json;
633 BasicVariantType v = false;
634 EXPECT_TRUE(matchProbe(j, v));
635}
636
637TEST(MatchProbe, doubleNeqTrue)
638{
639 nlohmann::json j = R"(1.1)"_json;
640 BasicVariantType v = true;
641 EXPECT_FALSE(matchProbe(j, v));
642}
643
644TEST(MatchProbe, doubleEqTrue)
645{
646 nlohmann::json j = R"(1.0)"_json;
647 BasicVariantType v = true;
648 EXPECT_TRUE(matchProbe(j, v));
649}
650
651TEST(MatchProbe, doubleEqInt32)
652{
653 nlohmann::json j = R"(-124.0)"_json;
654 BasicVariantType v = int32_t(-124);
655 EXPECT_TRUE(matchProbe(j, v));
656}
657
658TEST(MatchProbe, doubleNeqInt32)
659{
660 nlohmann::json j = R"(-124.0)"_json;
661 BasicVariantType v = int32_t(-123);
662 EXPECT_FALSE(matchProbe(j, v));
663}
664
665TEST(MatchProbe, doubleRoundNeqInt)
666{
667 nlohmann::json j = R"(124.7)"_json;
668 BasicVariantType v = int32_t(124);
669 EXPECT_FALSE(matchProbe(j, v));
670}
671TEST(MatchProbe, doubleEqDouble)
672{
673 nlohmann::json j = R"(-124.2)"_json;
674 BasicVariantType v = double(-124.2);
675 EXPECT_TRUE(matchProbe(j, v));
676}
677
678TEST(MatchProbe, doubleNeqDouble)
679{
680 nlohmann::json j = R"(-124.3)"_json;
681 BasicVariantType v = double(-124.2);
682 EXPECT_FALSE(matchProbe(j, v));
683}
684
685TEST(MatchProbe, doubleEmptyError)
686{
687 nlohmann::json j = R"(-11.0)"_json;
688 BasicVariantType v;
689 EXPECT_THROW(matchProbe(j, v), std::invalid_argument);
690}
Brad Bishopd14c2e22020-08-28 10:43:40 -0400691
692TEST(MatchProbe, arrayNeqString)
693{
694 nlohmann::json j = R"([1, 2])"_json;
695 BasicVariantType v = "hello"s;
696 EXPECT_FALSE(matchProbe(j, v));
697}
698
699TEST(MatchProbe, arrayNeqFalse)
700{
701 nlohmann::json j = R"([1, 2])"_json;
702 BasicVariantType v = false;
703 EXPECT_FALSE(matchProbe(j, v));
704}
705
706TEST(MatchProbe, arrayNeqTrue)
707{
708 nlohmann::json j = R"([1, 2])"_json;
709 BasicVariantType v = true;
710 EXPECT_FALSE(matchProbe(j, v));
711}
712
713TEST(MatchProbe, arrayNeqUint8)
714{
715 nlohmann::json j = R"([1, 2])"_json;
716 BasicVariantType v = uint8_t(1);
717 EXPECT_FALSE(matchProbe(j, v));
718}
719
720TEST(MatchProbe, arrayNeqInt32)
721{
722 nlohmann::json j = R"([1, 2])"_json;
723 BasicVariantType v = int32_t(-1);
724 EXPECT_FALSE(matchProbe(j, v));
725}
726
727TEST(MatchProbe, arrayNeqDouble)
728{
729 nlohmann::json j = R"([1, 2])"_json;
730 BasicVariantType v = double(1.1);
731 EXPECT_FALSE(matchProbe(j, v));
732}