diff options
author | Tor Egge <Tor.Egge@oath.com> | 2017-09-28 09:45:01 +0000 |
---|---|---|
committer | Tor Egge <Tor.Egge@oath.com> | 2017-09-28 09:45:01 +0000 |
commit | d044ff67f5e33be0f925ffdd359af0c783be7633 (patch) | |
tree | 2d15b97d255988588a6e706bd52b23e334062b04 /searchlib/src/tests/features/prod_features_attributematch.cpp | |
parent | 85e3ec191db3d843bfe0d8d58d3c0bbd7b082514 (diff) |
Test that setting up tensor attribute for attributeMatch feature fails.
Diffstat (limited to 'searchlib/src/tests/features/prod_features_attributematch.cpp')
-rw-r--r-- | searchlib/src/tests/features/prod_features_attributematch.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/searchlib/src/tests/features/prod_features_attributematch.cpp b/searchlib/src/tests/features/prod_features_attributematch.cpp index 8dcceec9a22..cab9c66a95b 100644 --- a/searchlib/src/tests/features/prod_features_attributematch.cpp +++ b/searchlib/src/tests/features/prod_features_attributematch.cpp @@ -18,6 +18,7 @@ using AVC = search::attribute::Config; using AVBT = search::attribute::BasicType; using AVCT = search::attribute::CollectionType; using CollectionType = FieldInfo::CollectionType; +using DataType = FieldInfo::DataType; void Test::testAttributeMatch() @@ -303,4 +304,13 @@ Test::testAttributeMatch() addScore("attributeMatch(wint).fieldCompleteness", 0); ASSERT_TRUE(ft.execute(exp)); } + { // tensor attribute is not allowed + FtFeatureTest ft(_factory, "attributeMatch(tensor)"); + ft.getIndexEnv().getBuilder().addField(FieldType::ATTRIBUTE, CollectionType::SINGLE, DataType::TENSOR, "tensor"); + AttributePtr tensorAttr = AttributeFactory::createAttribute("tensor", AVC (AVBT::TENSOR, AVCT::SINGLE)); + tensorAttr->addReservedDoc(); + ft.getIndexEnv().getAttributeMap().add(tensorAttr); + ASSERT_TRUE(ft.getQueryEnv().getBuilder().addAttributeNode("tensor") != nullptr); + ASSERT_TRUE(!ft.setup()); + } } |