diff options
Diffstat (limited to 'searchcommon/src/tests/schema')
-rw-r--r-- | searchcommon/src/tests/schema/imported-fields-cfg/attributes.cfg (renamed from searchcommon/src/tests/schema/imported-fields-cfg/imported-fields.cfg) | 11 | ||||
-rw-r--r-- | searchcommon/src/tests/schema/schema_test.cpp | 7 |
2 files changed, 12 insertions, 6 deletions
diff --git a/searchcommon/src/tests/schema/imported-fields-cfg/imported-fields.cfg b/searchcommon/src/tests/schema/imported-fields-cfg/attributes.cfg index d41ccc4bd61..9a08f7e2324 100644 --- a/searchcommon/src/tests/schema/imported-fields-cfg/imported-fields.cfg +++ b/searchcommon/src/tests/schema/imported-fields-cfg/attributes.cfg @@ -1,11 +1,12 @@ -attribute[2] +attribute[3] attribute[0].name imported_a -attribute[0].referencefield ref_a -attribute[0].targetfield target_a +attribute[0].imported true attribute[0].datatype INT32 attribute[0].collectiontype SINGLE attribute[1].name imported_b -attribute[1].referencefield ref_b -attribute[1].targetfield target_b +attribute[1].imported true attribute[1].datatype STRING attribute[1].collectiontype ARRAY +attribute[2].name regular +attribute[2].datatype INT32 +attribute[2].collectiontype SINGLE diff --git a/searchcommon/src/tests/schema/schema_test.cpp b/searchcommon/src/tests/schema/schema_test.cpp index cb35fbf4cb2..8a70e4f12df 100644 --- a/searchcommon/src/tests/schema/schema_test.cpp +++ b/searchcommon/src/tests/schema/schema_test.cpp @@ -411,14 +411,19 @@ TEST("require that imported attribute fields are not saved to disk") } } -TEST("require that schema can be built from imported-fields config") +TEST("require that schema can be built with imported attribute fields") { Schema s; SchemaConfigurer configurer(s, "dir:" + TEST_PATH("imported-fields-cfg")); + const auto &imported = s.getImportedAttributeFields(); EXPECT_EQUAL(2u, imported.size()); TEST_DO(assertField(SIAF("imported_a", DataType::INT32, CollectionType::SINGLE), imported[0])); TEST_DO(assertField(SIAF("imported_b", DataType::STRING, CollectionType::ARRAY), imported[1])); + + const auto ®ular = s.getAttributeFields(); + EXPECT_EQUAL(1u, regular.size()); + TEST_DO(assertField(SIAF("regular", DataType::INT32, CollectionType::SINGLE), regular[0])); } } // namespace index |