Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.

Commit 8ed4535

Browse files
committed
gherkin: Update testdata, ref #353. c,objective-c,perl,python are disabled until they are brought uptodate
1 parent db6ae6d commit 8ed4535

File tree

45 files changed

+71
-71
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+71
-71
lines changed

gherkin.berp

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
[
2-
Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ScenarioOutlineLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language
2+
Tokens -> #Empty,#Comment,#TagLine,#FeatureLine,#BackgroundLine,#ScenarioLine,#ExamplesLine,#StepLine,#DocStringSeparator,#TableRow,#Language
33
IgnoredTokens -> #Comment,#Empty
44
ClassName -> Parser
55
Namespace -> Gherkin
66
]
77

88
GherkinDocument! := Feature?
9-
Feature! := Feature_Header Background? Scenario_Definition*
10-
Feature_Header! := #Language? Tags? #FeatureLine Description_Helper
9+
Feature! := FeatureHeader Background? ScenarioDefinition*
10+
FeatureHeader! := #Language? Tags? #FeatureLine DescriptionHelper
1111

12-
Background! := #BackgroundLine Description_Helper Step*
12+
Background! := #BackgroundLine DescriptionHelper Step*
1313

14-
// we could avoid defining Scenario_Definition, but that would require regular look-aheads, so worse performance
15-
Scenario_Definition! := Tags? (Scenario | ScenarioOutline)
14+
// we could avoid defining ScenarioDefinition, but that would require regular look-aheads, so worse performance
15+
ScenarioDefinition! := Tags? Scenario
1616

17-
Scenario! := #ScenarioLine Description_Helper Step*
18-
19-
ScenarioOutline! := #ScenarioOutlineLine Description_Helper Step* Examples_Definition*
20-
// after the first "Examples" block, interpreting a tag line is ambiguous (tagline of next examples or of next scenario)
17+
Scenario! := #ScenarioLine DescriptionHelper Step* ExamplesDefinition*
18+
// after the first "Data" block, interpreting a tag line is ambiguous (tagline of next examples or of next scenario)
2119
// because of this, we need a lookahead hint, that connects the tag line to the next examples, if there is an examples block ahead
22-
Examples_Definition! [#Empty|#Comment|#TagLine->#ExamplesLine]:= Tags? Examples
23-
Examples! := #ExamplesLine Description_Helper Examples_Table?
24-
Examples_Table! := #TableRow #TableRow*
20+
ExamplesDefinition! [#Empty|#Comment|#TagLine->#ExamplesLine]:= Tags? Examples
21+
Examples! := #ExamplesLine DescriptionHelper ExamplesTable?
22+
ExamplesTable! := #TableRow #TableRow*
2523

26-
Step! := #StepLine Step_Arg?
27-
Step_Arg := (DataTable | DocString)
24+
Step! := #StepLine StepArg?
25+
StepArg := (DataTable | DocString)
2826

2927
DataTable! := #TableRow+
3028
DocString! := #DocStringSeparator #Other* #DocStringSeparator
@@ -33,5 +31,5 @@ Tags! := #TagLine+
3331

3432
// we need to explicitly mention comment, to avoid merging it into the description line's #Other token
3533
// we also eat the leading empty lines, the tailing lines are not removed by the parser to avoid lookahead, this has to be done by the AST builder
36-
Description_Helper := #Empty* Description? #Comment*
34+
DescriptionHelper := #Empty* Description? #Comment*
3735
Description! := #Other+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
{"data":"(2:1): expected: #EOF, #Language, #TagLine, #FeatureLine, #Comment, #Empty, got 'invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":2},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"}
2-
{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"}
2+
{"data":"(9:1): expected: #EOF, #TableRow, #DocStringSeparator, #StepLine, #TagLine, #ExamplesLine, #ScenarioLine, #Comment, #Empty, got 'another invalid line here'","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":1,"line":9},"uri":"testdata/bad/multiple_parser_errors.feature"},"type":"attachment"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"data":"(7:0): unexpected end of file, expected: #TagLine, #ScenarioLine, #ScenarioOutlineLine, #Comment, #Empty","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":0,"line":7},"uri":"testdata/bad/unexpected_eof.feature"},"type":"attachment"}
1+
{"data":"(7:0): unexpected end of file, expected: #TagLine, #ScenarioLine, #Comment, #Empty","media":{"encoding":"utf-8","type":"text/x.cucumber.stacktrace+plain"},"source":{"start":{"column":0,"line":7},"uri":"testdata/bad/unexpected_eof.feature"},"type":"attachment"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"a simple background","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism inside a background","type":"Step"}],"type":"Background"},{"keyword":"Scenario","location":{"column":3,"line":7},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":8},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Background","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/background.feature"}
1+
{"document":{"comments":[],"feature":{"children":[{"keyword":"Background","location":{"column":3,"line":3},"name":"a simple background","steps":[{"keyword":"Given ","location":{"column":5,"line":4},"text":"the minimalism inside a background","type":"Step"}],"type":"Background"},{"examples":[],"keyword":"Scenario","location":{"column":3,"line":7},"name":"minimalistic","steps":[{"keyword":"Given ","location":{"column":5,"line":8},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Background","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/background.feature"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"document":{"comments":[{"location":{"column":1,"line":17},"text":" # this is a comment","type":"Comment"}],"feature":{"children":[{"keyword":"Scenario","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"argument":{"location":{"column":7,"line":5},"rows":[{"cells":[{"location":{"column":9,"line":5},"type":"TableCell","value":"foo"},{"location":{"column":15,"line":5},"type":"TableCell","value":"bar"}],"location":{"column":7,"line":5},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":6},"type":"TableCell","value":"boz"},{"location":{"column":15,"line":6},"type":"TableCell","value":"boo"}],"location":{"column":7,"line":6},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":4},"text":"a simple data table","type":"Step"},{"argument":{"location":{"column":7,"line":8},"rows":[{"cells":[{"location":{"column":9,"line":8},"type":"TableCell","value":"foo"}],"location":{"column":7,"line":8},"type":"TableRow"}],"type":"DataTable"},"keyword":"And ","location":{"column":5,"line":7},"text":"a data table with a single cell","type":"Step"},{"argument":{"location":{"column":7,"line":10},"rows":[{"cells":[{"location":{"column":11,"line":10},"type":"TableCell","value":"foo"},{"location":{"column":15,"line":10},"type":"TableCell","value":"bar"},{"location":{"column":23,"line":10},"type":"TableCell","value":"boz"}],"location":{"column":7,"line":10},"type":"TableRow"}],"type":"DataTable"},"keyword":"And ","location":{"column":5,"line":9},"text":"a data table with different fromatting","type":"Step"},{"argument":{"location":{"column":7,"line":12},"rows":[{"cells":[{"location":{"column":8,"line":12},"type":"TableCell","value":"foo"},{"location":{"column":12,"line":12},"type":"TableCell","value":""},{"location":{"column":13,"line":12},"type":"TableCell","value":"boz"}],"location":{"column":7,"line":12},"type":"TableRow"}],"type":"DataTable"},"keyword":"And ","location":{"column":5,"line":11},"text":"a data table with an empty cell","type":"Step"},{"argument":{"location":{"column":7,"line":14},"rows":[{"cells":[{"location":{"column":9,"line":14},"type":"TableCell","value":"foo"},{"location":{"column":15,"line":14},"type":"TableCell","value":"bar"}],"location":{"column":7,"line":14},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":16},"type":"TableCell","value":"boz"},{"location":{"column":16,"line":16},"type":"TableCell","value":"boo"}],"location":{"column":7,"line":16},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":18},"type":"TableCell","value":"boz2"},{"location":{"column":16,"line":18},"type":"TableCell","value":"boo2"}],"location":{"column":7,"line":18},"type":"TableRow"}],"type":"DataTable"},"keyword":"And ","location":{"column":5,"line":13},"text":"a data table with comments and newlines inside","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"DataTables","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/datatables.feature"}
1+
{"document":{"comments":[{"location":{"column":1,"line":17},"text":" # this is a comment","type":"Comment"}],"feature":{"children":[{"examples":[],"keyword":"Scenario","location":{"column":3,"line":3},"name":"minimalistic","steps":[{"argument":{"location":{"column":7,"line":5},"rows":[{"cells":[{"location":{"column":9,"line":5},"type":"TableCell","value":"foo"},{"location":{"column":15,"line":5},"type":"TableCell","value":"bar"}],"location":{"column":7,"line":5},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":6},"type":"TableCell","value":"boz"},{"location":{"column":15,"line":6},"type":"TableCell","value":"boo"}],"location":{"column":7,"line":6},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":4},"text":"a simple data table","type":"Step"},{"argument":{"location":{"column":7,"line":8},"rows":[{"cells":[{"location":{"column":9,"line":8},"type":"TableCell","value":"foo"}],"location":{"column":7,"line":8},"type":"TableRow"}],"type":"DataTable"},"keyword":"And ","location":{"column":5,"line":7},"text":"a data table with a single cell","type":"Step"},{"argument":{"location":{"column":7,"line":10},"rows":[{"cells":[{"location":{"column":11,"line":10},"type":"TableCell","value":"foo"},{"location":{"column":15,"line":10},"type":"TableCell","value":"bar"},{"location":{"column":23,"line":10},"type":"TableCell","value":"boz"}],"location":{"column":7,"line":10},"type":"TableRow"}],"type":"DataTable"},"keyword":"And ","location":{"column":5,"line":9},"text":"a data table with different fromatting","type":"Step"},{"argument":{"location":{"column":7,"line":12},"rows":[{"cells":[{"location":{"column":8,"line":12},"type":"TableCell","value":"foo"},{"location":{"column":12,"line":12},"type":"TableCell","value":""},{"location":{"column":13,"line":12},"type":"TableCell","value":"boz"}],"location":{"column":7,"line":12},"type":"TableRow"}],"type":"DataTable"},"keyword":"And ","location":{"column":5,"line":11},"text":"a data table with an empty cell","type":"Step"},{"argument":{"location":{"column":7,"line":14},"rows":[{"cells":[{"location":{"column":9,"line":14},"type":"TableCell","value":"foo"},{"location":{"column":15,"line":14},"type":"TableCell","value":"bar"}],"location":{"column":7,"line":14},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":16},"type":"TableCell","value":"boz"},{"location":{"column":16,"line":16},"type":"TableCell","value":"boo"}],"location":{"column":7,"line":16},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":18},"type":"TableCell","value":"boz2"},{"location":{"column":16,"line":18},"type":"TableCell","value":"boo2"}],"location":{"column":7,"line":18},"type":"TableRow"}],"type":"DataTable"},"keyword":"And ","location":{"column":5,"line":13},"text":"a data table with comments and newlines inside","type":"Step"}],"tags":[],"type":"Scenario"}],"keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"DataTables","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/datatables.feature"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"document":{"comments":[{"location":{"column":1,"line":30},"text":"# this is a comment","type":"Comment"},{"location":{"column":1,"line":36},"text":" # this is another comment","type":"Comment"}],"feature":{"children":[{"description":" This description\n has two lines and indented with two spaces","keyword":"Scenario","location":{"column":3,"line":4},"name":"two lines","steps":[{"keyword":"Given ","location":{"column":5,"line":7},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":"This is a description without indentation","keyword":"Scenario","location":{"column":1,"line":9},"name":"without indentation","steps":[{"keyword":"Given ","location":{"column":3,"line":11},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":" This description\n\n has an empty line in the middle","keyword":"Scenario","location":{"column":3,"line":13},"name":"empty lines in the middle","steps":[{"keyword":"Given ","location":{"column":5,"line":17},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":" This description\n has an empty lines around","keyword":"Scenario","location":{"column":3,"line":19},"name":"empty lines around","steps":[{"keyword":"Given ","location":{"column":5,"line":24},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":" This description\n has a comment after","keyword":"Scenario","location":{"column":3,"line":26},"name":"comment after description","steps":[{"keyword":"Given ","location":{"column":5,"line":31},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":" This description\n has a comment right after","keyword":"Scenario","location":{"column":3,"line":33},"name":"comment right after description","steps":[{"keyword":"Given ","location":{"column":5,"line":38},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":" This description has an \\\"\\\"\\\" (escaped docstring sparator)","keyword":"Scenario","location":{"column":3,"line":40},"name":"description with escaped docstring separator","steps":[{"keyword":"Given ","location":{"column":5,"line":43},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":"This is a scenario outline description","examples":[{"description":"This is an examples description","keyword":"Examples","location":{"column":3,"line":49},"name":"examples with description","tableBody":[{"cells":[{"location":{"column":7,"line":52},"type":"TableCell","value":"bar"}],"location":{"column":5,"line":52},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":7,"line":51},"type":"TableCell","value":"foo"}],"location":{"column":5,"line":51},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":3,"line":45},"name":"scenario outline with a description","steps":[{"keyword":"Given ","location":{"column":5,"line":47},"text":"the minimalism","type":"Step"}],"tags":[],"type":"ScenarioOutline"}],"description":" This is a single line description","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Descriptions everywhere","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/descriptions.feature"}
1+
{"document":{"comments":[{"location":{"column":1,"line":30},"text":"# this is a comment","type":"Comment"},{"location":{"column":1,"line":36},"text":" # this is another comment","type":"Comment"}],"feature":{"children":[{"description":" This description\n has two lines and indented with two spaces","examples":[],"keyword":"Scenario","location":{"column":3,"line":4},"name":"two lines","steps":[{"keyword":"Given ","location":{"column":5,"line":7},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":"This is a description without indentation","examples":[],"keyword":"Scenario","location":{"column":1,"line":9},"name":"without indentation","steps":[{"keyword":"Given ","location":{"column":3,"line":11},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":" This description\n\n has an empty line in the middle","examples":[],"keyword":"Scenario","location":{"column":3,"line":13},"name":"empty lines in the middle","steps":[{"keyword":"Given ","location":{"column":5,"line":17},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":" This description\n has an empty lines around","examples":[],"keyword":"Scenario","location":{"column":3,"line":19},"name":"empty lines around","steps":[{"keyword":"Given ","location":{"column":5,"line":24},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":" This description\n has a comment after","examples":[],"keyword":"Scenario","location":{"column":3,"line":26},"name":"comment after description","steps":[{"keyword":"Given ","location":{"column":5,"line":31},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":" This description\n has a comment right after","examples":[],"keyword":"Scenario","location":{"column":3,"line":33},"name":"comment right after description","steps":[{"keyword":"Given ","location":{"column":5,"line":38},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":" This description has an \\\"\\\"\\\" (escaped docstring sparator)","examples":[],"keyword":"Scenario","location":{"column":3,"line":40},"name":"description with escaped docstring separator","steps":[{"keyword":"Given ","location":{"column":5,"line":43},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"},{"description":"This is a scenario outline description","examples":[{"description":"This is an examples description","keyword":"Examples","location":{"column":3,"line":49},"name":"examples with description","tableBody":[{"cells":[{"location":{"column":7,"line":52},"type":"TableCell","value":"bar"}],"location":{"column":5,"line":52},"type":"TableRow"}],"tableHeader":{"cells":[{"location":{"column":7,"line":51},"type":"TableCell","value":"foo"}],"location":{"column":5,"line":51},"type":"TableRow"},"tags":[],"type":"Examples"}],"keyword":"Scenario Outline","location":{"column":3,"line":45},"name":"scenario outline with a description","steps":[{"keyword":"Given ","location":{"column":5,"line":47},"text":"the minimalism","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" This is a single line description","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Descriptions everywhere","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/descriptions.feature"}

testdata/good/descriptions.feature.tokens

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
(42:1)Other://
4343
(43:5)StepLine:Given /the minimalism/
4444
(44:1)Empty://
45-
(45:3)ScenarioOutlineLine:Scenario Outline/scenario outline with a description/
45+
(45:3)ScenarioLine:Scenario Outline/scenario outline with a description/
4646
(46:1)Other:/This is a scenario outline description/
4747
(47:5)StepLine:Given /the minimalism/
4848
(48:1)Empty://

0 commit comments

Comments
 (0)