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

Function TEST_NAME

test/view_test.cpp:45–165  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

43
44////////////////////////////////////////////////////////////////////////////////
45int TEST_NAME(int, char**) {
46 UnitTest t(1);
47 Context context;
48 Context::setContext(&context);
49 context.tdb2.open_replica_in_memory();
50
51 // Ensure environment has no influence.
52 unsetenv("TASKDATA");
53 unsetenv("TASKRC");
54
55 try {
56 // Set up configuration.
57 context.config.parse(configurationDefaults);
58 context.config.set("fontunderline", true);
59 context.config.set("tag.indicator", "+");
60 context.config.set("dependency.indicator", "D");
61 context.config.set("recurrence.indicator", "R");
62 context.config.set("active.indicator", "A");
63 context.config.set("dateformat", "Y-M-D");
64 context.config.set("indent.annotation", "2");
65
66 // Two sample tasks.
67 t.ok(true, "zero");
68 Task t1(
69 "{"
70 "\"status\":\"pending\", "
71 "\"uuid\":\"2a64f6e0-bf8e-430d-bf71-9ec3f0d9b661\", "
72 "\"description\":\"This is the description text\", "
73 "\"project\":\"Home\", "
74 "\"priority\":\"H\", "
75 "\"annotation_1234567890\":\"This is an annotation\", "
76 "\"start\":\"1234567890\", "
77 "\"due\":\"1234567890\", "
78 "\"tags\":\"one,two\""
79 "}");
80 t1.id = 1;
81 t.ok(true, "one");
82 Task t2(
83 "{"
84 "\"status\":\"pending\", "
85 "\"uuid\":\"f30cb9c3-3fc0-483f-bfb2-3bf134f00694\", "
86 "\"description\":\"This is the description text\", "
87 "\"project\":\"Garden Care\", "
88 "\"recur\":\"monthly\", "
89 "\"depends\":\"2a64f6e0-bf8e-430d-bf71-9ec3f0d9b661\""
90 "}");
91 t2.id = 11;
92 t.ok(true, "two");
93 Task t3(
94 "{"
95 "\"status\":\"pending\", "
96 "\"uuid\":\"c44cb9c3-3fc0-483f-bfb2-3bf134f05554\", "
97 "\"description\":\"Another description\", "
98 "\"project\":\"Garden\""
99 "}");
100 t3.id = 8;
101 t.ok(true, "three");
102

Callers

nothing calls this directly

Calls 15

sort_tasksFunction · 0.85
parseMethod · 0.80
setMethod · 0.80
okMethod · 0.80
widthMethod · 0.80
getWidthMethod · 0.80
leftMarginMethod · 0.80
extraPaddingMethod · 0.80
intraPaddingMethod · 0.80
colorHeaderMethod · 0.80
colorOddMethod · 0.80

Tested by

no test coverage detected