@@ -15,32 +15,35 @@ Y_UNIT_TEST_SUITE (TableIndex) {
15
15
auto type = NKikimrSchemeOp::EIndexType::EIndexTypeGlobal;
16
16
17
17
UNIT_ASSERT (IsCompatibleIndex (type, Table, {{" DATA1" }, {}}, explain));
18
- UNIT_ASSERT (explain. empty () );
18
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
19
19
20
20
UNIT_ASSERT (IsCompatibleIndex (type, Table, {{" DATA1" , " DATA2" }, {}}, explain));
21
- UNIT_ASSERT (explain. empty () );
21
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
22
22
23
23
UNIT_ASSERT (IsCompatibleIndex (type, Table, {{" PK1" , " PK2" }, {}}, explain));
24
- UNIT_ASSERT (explain. empty () );
24
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
25
25
26
26
UNIT_ASSERT (IsCompatibleIndex (type, Table, {{" DATA1" }, {" DATA3" }}, explain));
27
- UNIT_ASSERT (explain. empty () );
27
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
28
28
29
29
{
30
30
const TTableColumns Table2{{" PK" , " DATA" , NTableVectorKmeansTreeIndex::PostingTable_ParentIdColumn}, {" PK" }};
31
31
32
32
UNIT_ASSERT (IsCompatibleIndex (type, Table2, {{NTableVectorKmeansTreeIndex::PostingTable_ParentIdColumn}, {}}, explain));
33
- UNIT_ASSERT (explain. empty () );
33
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
34
34
35
35
UNIT_ASSERT (IsCompatibleIndex (type, Table2, {{" DATA" }, {NTableVectorKmeansTreeIndex::PostingTable_ParentIdColumn}}, explain));
36
- UNIT_ASSERT (explain. empty () );
36
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
37
37
}
38
38
{
39
39
const TTableColumns Table3{{" PK" , " DATA" , NTableVectorKmeansTreeIndex::PostingTable_ParentIdColumn}, {NTableVectorKmeansTreeIndex::PostingTable_ParentIdColumn}};
40
40
41
41
UNIT_ASSERT (IsCompatibleIndex (type, Table3, {{" DATA" }, {}}, explain));
42
- UNIT_ASSERT (explain. empty () );
42
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
43
43
}
44
+
45
+ UNIT_ASSERT (IsCompatibleIndex (type, Table, {{" PK2" }, {}}, explain));
46
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
44
47
}
45
48
46
49
Y_UNIT_TEST (NotCompatibleSecondaryIndex) {
@@ -71,25 +74,25 @@ Y_UNIT_TEST_SUITE (TableIndex) {
71
74
UNIT_ASSERT (!IsCompatibleIndex (type, Table, {{}, {}}, explain));
72
75
UNIT_ASSERT_STRINGS_EQUAL (explain, " should be at least single index key column" );
73
76
74
- UNIT_ASSERT (!IsCompatibleIndex (type, Table, {{" PK2" }, {}}, explain));
75
- UNIT_ASSERT_STRINGS_EQUAL (explain, " index keys are prefix of table keys" );
77
+ UNIT_ASSERT (!IsCompatibleIndex (type, Table, {{" PK2" , " PK1 " }, {}}, explain));
78
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " index keys shouldn't be table keys" );
76
79
}
77
80
78
81
Y_UNIT_TEST (CompatibleVectorIndex) {
79
82
TString explain;
80
83
auto type = NKikimrSchemeOp::EIndexType::EIndexTypeGlobalVectorKmeansTree;
81
84
82
85
UNIT_ASSERT (IsCompatibleIndex (type, Table, {{" DATA1" }, {}}, explain));
83
- UNIT_ASSERT (explain. empty () );
86
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
84
87
85
88
UNIT_ASSERT (IsCompatibleIndex (type, Table, {{" DATA1" }, {" DATA3" }}, explain));
86
- UNIT_ASSERT (explain. empty () );
89
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
87
90
88
91
UNIT_ASSERT (IsCompatibleIndex (type, Table, {{" PK1" }, {}}, explain));
89
- UNIT_ASSERT (explain. empty () );
92
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
90
93
91
94
UNIT_ASSERT (IsCompatibleIndex (type, Table, {{" DATA1" }, {" DATA1" }}, explain));
92
- UNIT_ASSERT (explain. empty () );
95
+ UNIT_ASSERT_STRINGS_EQUAL (explain, " " );
93
96
}
94
97
95
98
Y_UNIT_TEST (NotCompatibleVectorIndex) {
0 commit comments