Skip to content

Commit

Permalink
Move test for not supported FILTER functions to the "planner_test.go"…
Browse files Browse the repository at this point in the history
… level
  • Loading branch information
rogerlucena committed Sep 24, 2020
1 parent 04e857e commit 699b5f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 33 deletions.
7 changes: 0 additions & 7 deletions bql/grammar/grammar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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<peter> ?p ?o .
FILTER notSupportedFilterFunction(?p)
};`,
}
p, err := NewParser(SemanticBQL())
if err != nil {
Expand Down
8 changes: 8 additions & 0 deletions bql/planner/planner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,14 @@ func TestPlannerQueryError(t *testing.T) {
FILTER latest(?b_not_exist)
};`,
},
{
q: `SELECT ?p, ?o
FROM ?test
WHERE {
/u<peter> ?p ?o .
FILTER notSupportedFilterFunction(?p)
};`,
},
}

s, ctx := memory.NewStore(), context.Background()
Expand Down
26 changes: 0 additions & 26 deletions bql/semantic/hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 699b5f3

Please sign in to comment.