Skip to content

Commit 96b4a54

Browse files
committed
fix(linter): address review feedback for incoherent_min_max_contains
Signed-off-by: Vaibhav mittal <vaibhavmittal929@gmail.com>
1 parent 22019b2 commit 96b4a54

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

test/alterschema/alterschema_lint_2019_09_test.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2382,9 +2382,15 @@ TEST(AlterSchema_lint_2019_09, incoherent_min_max_contains_9) {
23822382
LINT_WITHOUT_FIX(document, result, traces);
23832383

23842384
EXPECT_FALSE(result.first);
2385-
for (const auto &trace : traces) {
2386-
EXPECT_NE(std::get<1>(trace), "incoherent_min_max_contains");
2387-
}
2385+
EXPECT_EQ(traces.size(), 2);
2386+
EXPECT_LINT_TRACE(traces, 0, "", "max_contains_without_contains",
2387+
"The `maxContains` keyword is meaningless "
2388+
"without the presence of the `contains` keyword",
2389+
true);
2390+
EXPECT_LINT_TRACE(traces, 1, "", "min_contains_without_contains",
2391+
"The `minContains` keyword is meaningless "
2392+
"without the presence of the `contains` keyword",
2393+
true);
23882394
}
23892395

23902396
TEST(AlterSchema_lint_2019_09, equal_numeric_bounds_to_const_1) {

test/alterschema/alterschema_lint_2020_12_test.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,9 +2286,15 @@ TEST(AlterSchema_lint_2020_12, incoherent_min_max_contains_9) {
22862286
LINT_WITHOUT_FIX(document, result, traces);
22872287

22882288
EXPECT_FALSE(result.first);
2289-
for (const auto &trace : traces) {
2290-
EXPECT_NE(std::get<1>(trace), "incoherent_min_max_contains");
2291-
}
2289+
EXPECT_EQ(traces.size(), 2);
2290+
EXPECT_LINT_TRACE(traces, 0, "", "max_contains_without_contains",
2291+
"The `maxContains` keyword is meaningless "
2292+
"without the presence of the `contains` keyword",
2293+
true);
2294+
EXPECT_LINT_TRACE(traces, 1, "", "min_contains_without_contains",
2295+
"The `minContains` keyword is meaningless "
2296+
"without the presence of the `contains` keyword",
2297+
true);
22922298
}
22932299

22942300
TEST(AlterSchema_lint_2020_12, equal_numeric_bounds_to_const_1) {

0 commit comments

Comments
 (0)