Skip to content

Commit

Permalink
Separated grammar test fields into multiple lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
apr94 committed Jul 20, 2017
1 parent b60eced commit cff771d
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions bql/grammar/grammar_test.go
Expand Up @@ -352,7 +352,11 @@ func TestAcceptGraphOpsByParseAndSemantic(t *testing.T) {
from ?b
where {?s "old_predicate_1"@[,] ?o1.
?s "old_predicate_2"@[,] ?o2.
?s "old_predicate_3"@[,] ?o3};`, empty, []string{"?b"}, []string{"?a"}, 0},
?s "old_predicate_3"@[,] ?o3};`,
empty,
[]string{"?b"},
[]string{"?a"},
0},

// Construct data into multiple output graphs from multple input graphs.
{`construct {?s "predicate_1"@[] ?o1;
Expand All @@ -361,23 +365,35 @@ func TestAcceptGraphOpsByParseAndSemantic(t *testing.T) {
from ?c, ?d
where {?s "old_predicate_1"@[,] ?o1.
?s "old_predicate_2"@[,] ?o2.
?s "old_predicate_3"@[,] ?o3};`, empty, []string{"?c", "?d"}, []string{"?a", "?b"}, 0},
?s "old_predicate_3"@[,] ?o3};`,
empty,
[]string{"?c", "?d"},
[]string{"?a", "?b"},
0},

// Deconstruct data. Graphs can be input or output graphs.
{`deconstruct {?s "predicate_1"@[] ?o1}
in ?a
from ?b
where {?s "old_predicate_1"@[,] ?o1.
?s "old_predicate_2"@[,] ?o2.
?s "old_predicate_3"@[,] ?o3};`, empty, []string{"?b"}, []string{"?a"}, 0},
?s "old_predicate_3"@[,] ?o3};`,
empty,
[]string{"?b"},
[]string{"?a"},
0},

// Deconstruct data at multiple output graphs from multple input graphs.
{`deconstruct {?s "predicate_1"@[] ?o1}
in ?a, ?b
from ?c, ?d
where {?s "old_predicate_1"@[,] ?o1.
?s "old_predicate_2"@[,] ?o2.
?s "old_predicate_3"@[,] ?o3};`, empty, []string{"?c", "?d"}, []string{"?a", "?b"}, 0},
?s "old_predicate_3"@[,] ?o3};`,
empty,
[]string{"?c", "?d"},
[]string{"?a", "?b"},
0},
}
p, err := NewParser(SemanticBQL())
if err != nil {
Expand Down

0 comments on commit cff771d

Please sign in to comment.