MCPcopy Create free account
hub / github.com/GothenburgBitFactory/taskwarrior / TEST_NAME

Function TEST_NAME

test/variant_exp_test.cpp:36–329  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

34
35////////////////////////////////////////////////////////////////////////////////
36int TEST_NAME(int, char**) {
37 UnitTest t(38);
38
39 Variant v0(true);
40 Variant v1(42);
41 Variant v2(3.14);
42 Variant v3("foo");
43 Variant v4(1234567890, Variant::type_date);
44 Variant v5(1200, Variant::type_duration);
45
46 // boolean ^ boolean -> ERROR
47 try {
48 Variant v00 = v0 ^ v0;
49 t.fail("true ^ true --> error");
50 } catch (...) {
51 t.pass("true ^ true --> error");
52 }
53
54 // boolean ^ integer -> ERROR
55 try {
56 Variant v01 = v0 ^ v1;
57 t.fail("true ^ 42 --> error");
58 } catch (...) {
59 t.pass("true ^ 42 --> error");
60 }
61
62 // boolean ^ real -> ERROR
63 try {
64 Variant v02 = v0 ^ v2;
65 t.fail("true ^ 3.14 --> error");
66 } catch (...) {
67 t.pass("true ^ 3.14 --> error");
68 }
69
70 // boolean ^ string -> ERROR
71 try {
72 Variant v03 = v0 ^ v3;
73 t.fail("true ^ foo --> error");
74 } catch (...) {
75 t.pass("true ^ foo --> error");
76 }
77
78 // boolean ^ date -> ERROR
79 try {
80 Variant v04 = v0 ^ v4;
81 t.fail("true ^ 1234567890 --> error");
82 } catch (...) {
83 t.pass("true ^ 1234567890 --> error");
84 }
85
86 // boolean ^ duration -> ERROR
87 try {
88 Variant v05 = v0 ^ v5;
89 t.fail("true ^ 1200 --> error");
90 } catch (...) {
91 t.pass("true ^ 1200 --> error");
92 }
93

Callers

nothing calls this directly

Calls 7

VariantClass · 0.85
failMethod · 0.80
passMethod · 0.80
isMethod · 0.80
typeMethod · 0.80
get_integerMethod · 0.80
get_realMethod · 0.80

Tested by

no test coverage detected