From 374eac070a50314aaa5a88c5f214a4f32a197146 Mon Sep 17 00:00:00 2001 From: Roger Leite Lucena Date: Thu, 24 Sep 2020 15:06:01 -0300 Subject: [PATCH] Move test for not supported FILTER functions to the "planner_test.go" level --- bql/grammar/grammar_test.go | 7 ------- bql/planner/planner_test.go | 8 ++++++++ bql/semantic/hooks_test.go | 26 -------------------------- 3 files changed, 8 insertions(+), 33 deletions(-) diff --git a/bql/grammar/grammar_test.go b/bql/grammar/grammar_test.go index 6cbfa1c5..96f56d60 100644 --- a/bql/grammar/grammar_test.go +++ b/bql/grammar/grammar_test.go @@ -676,13 +676,6 @@ func TestRejectByParseAndSemantic(t *testing.T) { `select ?s as ?a, ?o as ?b, ?o as ?c from ?g where{?s ?p ?o} order by ?a ASC, ?a DESC;`, // Wrong limit literal. `select ?s as ?a, ?o as ?b, ?o as ?c from ?g where{?s ?p ?o} LIMIT "true"^^type:bool;`, - // Reject not supported FILTER function. - `select ?p, ?o - from ?test - where { - /u ?p ?o . - FILTER notSupportedFilterFunction(?p) - };`, } p, err := NewParser(SemanticBQL()) if err != nil { diff --git a/bql/planner/planner_test.go b/bql/planner/planner_test.go index 7e0850d4..944e8f1d 100644 --- a/bql/planner/planner_test.go +++ b/bql/planner/planner_test.go @@ -1218,6 +1218,14 @@ func TestPlannerQueryError(t *testing.T) { FILTER latest(?b_not_exist) };`, }, + { + q: `SELECT ?p, ?o + FROM ?test + WHERE { + /u ?p ?o . + FILTER notSupportedFilterFunction(?p) + };`, + }, } s, ctx := memory.NewStore(), context.Background() diff --git a/bql/semantic/hooks_test.go b/bql/semantic/hooks_test.go index 6bb25905..69bfef9a 100644 --- a/bql/semantic/hooks_test.go +++ b/bql/semantic/hooks_test.go @@ -284,32 +284,6 @@ func TestWhereFilterClauseHookError(t *testing.T) { ces []ConsumedElement ceIndexError int }{ - { - id: "FILTER notSupportedFilterFunction(?p)", - ces: []ConsumedElement{ - NewConsumedToken(&lexer.Token{ - Type: lexer.ItemFilter, - Text: "FILTER", - }), - NewConsumedToken(&lexer.Token{ - Type: lexer.ItemFilterFunction, - Text: "notSupportedFilterFunction", - }), - NewConsumedToken(&lexer.Token{ - Type: lexer.ItemLPar, - Text: "(", - }), - NewConsumedToken(&lexer.Token{ - Type: lexer.ItemBinding, - Text: "?p", - }), - NewConsumedToken(&lexer.Token{ - Type: lexer.ItemRPar, - Text: ")", - }), - }, - ceIndexError: 1, - }, { id: "FILTER latest latest(?p)", ces: []ConsumedElement{