Skip to content

Commit

Permalink
Add syntax tests to main DAWG runner.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed May 9, 2015
1 parent d75a3ca commit ec764aa
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions spec/dawg_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,29 @@
expect(result).to describe_csv_solutions(t.solutions)
expect {result.to_csv}.not_to raise_error
end
when 'mf:PositiveSyntaxTest', 'mf:PositiveSyntaxTest11'
it "positive syntax for #{t.entry} - #{t.name} - #{t.comment}" do
expect {SPARQL.parse(t.action.query_string, validate: true)}.not_to raise_error
end
when 'mf:NegativeSyntaxTest', 'mf:NegativeSyntaxTest11'
it "detects syntax error for #{t.entry} - #{t.name} - #{t.comment}" do
pending("Better Error Detection") if %w(
syn-blabel-cross-graph-bad.rq syn-blabel-cross-optional-bad.rq syn-blabel-cross-union-bad.rq
syn-bad-34.rq syn-bad-35.rq syn-bad-36.rq syn-bad-37.rq syn-bad-38.rq
syn-bad-OPT-breaks-BGP.rq syn-bad-UNION-breaks-BGP.rq syn-bad-GRAPH-breaks-BGP.rq
agg08.rq agg09.rq agg10.rq agg11.rq agg12.rq
syntax-BINDscope6.rq syntax-BINDscope7.rq syntax-BINDscope8.rq
syntax-SELECTscope2.rq
syn-bad-pname-06.rq
).include?(t.entry)
pending("Better Error Detection") if %w(
syn-bad-01.rq syn-bad-02.rq
).include?(t.entry) && man_name == 'syntax-query'
pending("New problem with different manifest processing?") if %w(
group06.rq group07.rq
).include?(t.entry)
expect {SPARQL.parse(t.action.query_string, validate: true)}.to raise_error
end
when 'ut:UpdateEvaluationTest', 'mf:UpdateEvaluationTest'
it "evaluates #{t.entry} - #{t.name}: #{t.comment}" do
# Load default and named graphs for result dataset
Expand All @@ -78,10 +101,19 @@

expect(result).to describe_solutions(expected, t)
end
when 'mf:PositiveSyntaxTest', 'mf:PositiveSyntaxTest11',
'mf:NegativeSyntaxTest', 'mf:NegativeSyntaxTest11',
'mf:PositiveUpdateSyntaxTest11', 'mf:NegativeUpdateSyntaxTest11',
'mf:ServiceDescriptionTest', 'mf:ProtocolTest',
when 'mf:PositiveUpdateSyntaxTest11'
it "positive syntax test for #{t.entry} - #{t.name} - #{t.comment}" do
pending("Whitespace in string tokens") if %w(
syntax-update-26.ru syntax-update-27.ru syntax-update-28.ru
syntax-update-36.ru
).include?(t.entry)
expect {SPARQL.parse(t.action.query_string, update: true, validate: true)}.not_to raise_error
end
when 'mf:NegativeUpdateSyntaxTest11'
it "detects syntax error for #{t.entry} - #{t.name} - #{t.comment}" do
expect {SPARQL.parse(t.action.query_string, update: true, validate: true)}.to raise_error
end
when 'mf:ServiceDescriptionTest', 'mf:ProtocolTest',
'mf:GraphStoreProtocolTest'
# Skip Other
else
Expand Down

0 comments on commit ec764aa

Please sign in to comment.