diff options
author | Håvard Pettersen <havardpe@oath.com> | 2019-04-10 09:50:06 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2019-04-25 12:24:03 +0000 |
commit | 974a0f2d3c588e35165177ac556e08cfdcc0e26f (patch) | |
tree | 46551c364a6cd1ee3cf88292f30537870f2956b4 /searchlib/src/tests/features/ranking_expression | |
parent | b186ca34ab5df612a463334772788752e1deec3c (diff) |
avoid abstract value types
remove basic value type ANY
remove concept of tensors with unknown dimensions
disallow value types with unbound indexed dimensions
remove predicates talking about abstract types
type of unknown values are now ERROR (was ANY)
require that overlapping indexed dimensions are of equal size
type unification now requires types to be equal ('if' expressions)
creating a tensor type without dimensions now gives a double type
make rank feature setup fail on invalid types (query/attribute)
Diffstat (limited to 'searchlib/src/tests/features/ranking_expression')
-rw-r--r-- | searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp b/searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp index 2419f450950..c7c3447a4cc 100644 --- a/searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp +++ b/searchlib/src/tests/features/ranking_expression/ranking_expression_test.cpp @@ -54,7 +54,7 @@ ExpressionReplacer::SP make_replacer() { auto replacer = std::make_shared<ListExpressionReplacer>(); replacer->add(std::make_unique<NullExpressionReplacer>()); replacer->add(std::make_unique<DummyReplacer>("foo", FeatureType::number())); - replacer->add(std::make_unique<DummyReplacer>("bar", FeatureType::object(ValueType::from_spec("tensor(x[])")))); + replacer->add(std::make_unique<DummyReplacer>("bar", FeatureType::object(ValueType::from_spec("tensor(x[5])")))); return replacer; } @@ -124,15 +124,6 @@ TEST("require that ranking expression can resolve to concrete complex type") { FeatureType::object(ValueType::from_spec("tensor(x{},y{},z{})")))); } -TEST("require that ranking expression can resolve to abstract complex type") { - TEST_DO(verify_output_type({{"a", "tensor"}}, "a*b", FeatureType::object(ValueType::from_spec("tensor")))); -} - -TEST("require that ranking expression can resolve to 'any' type") { - TEST_DO(verify_output_type({{"a", "tensor(x{},y{})"}, {"b", "tensor"}}, "a*b", - FeatureType::object(ValueType::from_spec("any")))); -} - TEST("require that setup fails for incompatible types") { TEST_DO(verify_setup_fail({{"a", "tensor(x{},y{})"}, {"b", "tensor(y[10],z{})"}}, "a*b")); } @@ -150,7 +141,7 @@ TEST("require that replaced expressions override result type") { TEST_DO(verify_output_type({{"b", "tensor(z{})"}}, "foo*b*c", FeatureType::number())); TEST_DO(verify_output_type({{"b", "tensor(z{})"}}, "a*b*bar", - FeatureType::object(ValueType::from_spec("tensor(x[])")))); + FeatureType::object(ValueType::from_spec("tensor(x[5])")))); TEST_DO(verify_output_type({{"b", "tensor(z{})"}}, "foo*b*bar", FeatureType::number())); } |