| 94 | } |
| 95 | |
| 96 | UNIT_CLASS_TEST(BookmarksProcessorTest, Smoke) |
| 97 | { |
| 98 | GetProcessor().EnableIndexingOfDescriptions(true); |
| 99 | |
| 100 | Add(Id{10}, GroupId{0}, |
| 101 | MakeBookmarkData("Double R Diner" /* name */, "2R Diner" /* customName */, |
| 102 | "They've got a cherry pie there that'll kill ya!" /* description */, |
| 103 | {"amenity-cafe"} /* types */)); |
| 104 | |
| 105 | Add(Id{18}, GroupId{0}, |
| 106 | MakeBookmarkData("Silver Mustang Casino" /* name */, "Ag Mustang" /* customName */, |
| 107 | "Joyful place, owners Bradley and Rodney are very friendly!" /* description */, |
| 108 | {"amenity-casino"} /* types */)); |
| 109 | Add(Id{20}, GroupId{1}, |
| 110 | MakeBookmarkData("Great Northern Hotel" /* name */, "N Hotel" /* customName */, |
| 111 | "Clean place with a reasonable price" /* description */, {"tourism-hotel"} /* types */)); |
| 112 | |
| 113 | TEST_EQUAL(Search("R&R food"), Ids{}, ()); |
| 114 | GetProcessor().EnableIndexingOfBookmarkGroup(GroupId{0}, true /* enable */); |
| 115 | TEST_EQUAL(Search("R&R food"), Ids({10}), ()); |
| 116 | GetProcessor().EnableIndexingOfBookmarkGroup(GroupId{0}, false /* enable */); |
| 117 | TEST_EQUAL(Search("R&R food"), Ids{}, ()); |
| 118 | GetProcessor().EnableIndexingOfBookmarkGroup(GroupId{0}, true /* enable */); |
| 119 | TEST_EQUAL(Search("R&R food"), Ids({10}), ()); |
| 120 | |
| 121 | GetProcessor().EnableIndexingOfBookmarkGroup(GroupId{1}, true /* enable */); |
| 122 | |
| 123 | TEST_EQUAL(Search("cherry pie"), Ids({10}), ()); |
| 124 | TEST_EQUAL(Search("great silver hotel"), Ids({20, 18}), ()); |
| 125 | TEST_EQUAL(Search("double r cafe"), Ids({10}), ()); |
| 126 | TEST_EQUAL(Search("dine"), Ids({10}), ()); |
| 127 | TEST_EQUAL(Search("2R"), Ids({10}), ()); |
| 128 | TEST_EQUAL(Search("Ag"), Ids({18}), ()); |
| 129 | |
| 130 | TEST_EQUAL(Search("place"), Ids({20, 18}), ()); |
| 131 | TEST_EQUAL(Search("place", GroupId{0}), Ids({18}), ()); |
| 132 | DetachFromGroup(Id{20}, GroupId{1}); |
| 133 | AttachToGroup(Id{20}, GroupId{0}); |
| 134 | TEST_EQUAL(Search("place", GroupId{0}), Ids({20, 18}), ()); |
| 135 | |
| 136 | Update(20, MakeBookmarkData("Great Northern Hotel" /* name */, "N Hotel" /* customName */, |
| 137 | "Clean establishment with a reasonable price" /* description */, |
| 138 | {"tourism-hotel"} /* types */)); |
| 139 | TEST_EQUAL(Search("place", GroupId{0}), Ids({18}), ()); |
| 140 | |
| 141 | GetProcessor().Reset(); |
| 142 | TEST_EQUAL(Search("place", GroupId{0}), Ids{}, ()); |
| 143 | } |
| 144 | |
| 145 | UNIT_CLASS_TEST(BookmarksProcessorTest, SearchByType) |
| 146 | { |
nothing calls this directly
no test coverage detected