[core] Check type of a convertible value when constructing legacy filter

This commit is contained in:
Alexander Shalamov
2019-08-15 23:01:51 +03:00
parent 8e1bd18eae
commit 5f477e310b
2 changed files with 13 additions and 1 deletions

View File

@@ -255,3 +255,10 @@ TEST(Filter, Internal) {
TEST(Filter, Short) {
filter(R"(["==", ["id"], "foo"])");
}
TEST(Filter, LegacyExpressionInvalidType) {
const JSValue value("string");
conversion::Error error;
optional<Filter> result = conversion::convert<Filter>(conversion::Convertible(&value), error);
EXPECT_FALSE(result);
}