Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gherkin: Retain leading and trailing newlines in data table cells #293

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions gherkin/c/testdata/good/escaped_pipes.feature
Expand Up @@ -4,8 +4,8 @@ Feature: Escaped pipes

Scenario: They are the future
Given they have arrived
| æ | o |
| a | ø |
| \næ\n | \to\t |
| a | ø |
Given they have arrived
| \|æ\\n | \o\no\ |
| \\\|a\\\\n | ø\\\nø\\|
2 changes: 1 addition & 1 deletion gherkin/c/testdata/good/escaped_pipes.feature.ast.ndjson
@@ -1 +1 @@
{"document":{"comments":[],"feature":{"children":[{"keyword":"Scenario","location":{"column":3,"line":5},"name":"They are the future","steps":[{"argument":{"location":{"column":7,"line":7},"rows":[{"cells":[{"location":{"column":9,"line":7},"type":"TableCell","value":"æ"},{"location":{"column":13,"line":7},"type":"TableCell","value":"o"}],"location":{"column":7,"line":7},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":8},"type":"TableCell","value":"a"},{"location":{"column":13,"line":8},"type":"TableCell","value":"ø"}],"location":{"column":7,"line":8},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":6},"text":"they have arrived","type":"Step"},{"argument":{"location":{"column":7,"line":10},"rows":[{"cells":[{"location":{"column":9,"line":10},"type":"TableCell","value":"|æ\\n"},{"location":{"column":22,"line":10},"type":"TableCell","value":"\\o\no\\"}],"location":{"column":7,"line":10},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":11},"type":"TableCell","value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"type":"TableCell","value":"ø\\\nø\\"}],"location":{"column":7,"line":11},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":9},"text":"they have arrived","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Escaped pipes","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/escaped_pipes.feature"}
{"document":{"comments":[],"feature":{"children":[{"keyword":"Scenario","location":{"column":3,"line":5},"name":"They are the future","steps":[{"argument":{"location":{"column":7,"line":7},"rows":[{"cells":[{"location":{"column":9,"line":7},"type":"TableCell","value":"\næ\n"},{"location":{"column":17,"line":7},"type":"TableCell","value":"\\to\\t"}],"location":{"column":7,"line":7},"type":"TableRow"},{"cells":[{"location":{"column":11,"line":8},"type":"TableCell","value":"a"},{"location":{"column":19,"line":8},"type":"TableCell","value":"ø"}],"location":{"column":7,"line":8},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":6},"text":"they have arrived","type":"Step"},{"argument":{"location":{"column":7,"line":10},"rows":[{"cells":[{"location":{"column":9,"line":10},"type":"TableCell","value":"|æ\\n"},{"location":{"column":22,"line":10},"type":"TableCell","value":"\\o\no\\"}],"location":{"column":7,"line":10},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":11},"type":"TableCell","value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"type":"TableCell","value":"ø\\\nø\\"}],"location":{"column":7,"line":11},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":9},"text":"they have arrived","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Escaped pipes","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/escaped_pipes.feature"}
@@ -1 +1 @@
{"pickle":{"language":"en","locations":[{"column":3,"line":5}],"name":"They are the future","steps":[{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":7},"value":"æ"},{"location":{"column":13,"line":7},"value":"o"}]},{"cells":[{"location":{"column":9,"line":8},"value":"a"},{"location":{"column":13,"line":8},"value":"ø"}]}]}],"locations":[{"column":11,"line":6}],"text":"they have arrived"},{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":10},"value":"|æ\\n"},{"location":{"column":22,"line":10},"value":"\\o\no\\"}]},{"cells":[{"location":{"column":9,"line":11},"value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"value":"ø\\\nø\\"}]}]}],"locations":[{"column":11,"line":9}],"text":"they have arrived"}],"tags":[]},"type":"pickle","uri":"testdata/good/escaped_pipes.feature"}
{"pickle":{"language":"en","locations":[{"column":3,"line":5}],"name":"They are the future","steps":[{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":7},"value":"\næ\n"},{"location":{"column":17,"line":7},"value":"\\to\\t"}]},{"cells":[{"location":{"column":11,"line":8},"value":"a"},{"location":{"column":19,"line":8},"value":"ø"}]}]}],"locations":[{"column":11,"line":6}],"text":"they have arrived"},{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":10},"value":"|æ\\n"},{"location":{"column":22,"line":10},"value":"\\o\no\\"}]},{"cells":[{"location":{"column":9,"line":11},"value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"value":"ø\\\nø\\"}]}]}],"locations":[{"column":11,"line":9}],"text":"they have arrived"}],"tags":[]},"type":"pickle","uri":"testdata/good/escaped_pipes.feature"}
@@ -1 +1 @@
{"data":"Feature: Escaped pipes\n The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.\n\n Scenario: They are the future\n Given they have arrived\n | æ | o |\n | a | ø |\n Given they have arrived\n | \\|æ\\\\n | \\o\\no\\ |\n | \\\\\\|a\\\\\\\\n | ø\\\\\\nø\\\\|\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/escaped_pipes.feature"}
{"data":"Feature: Escaped pipes\n The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.\n\n Scenario: They are the future\n Given they have arrived\n | \\næ\\n | \\to\\t |\n | a | ø |\n Given they have arrived\n | \\|æ\\\\n | \\o\\no\\ |\n | \\\\\\|a\\\\\\\\n | ø\\\\\\nø\\\\|\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/escaped_pipes.feature"}
6 changes: 4 additions & 2 deletions gherkin/c/testdata/good/escaped_pipes.feature.tokens
Expand Up @@ -4,8 +4,10 @@
(4:1)Other://
(5:3)ScenarioLine:Scenario/They are the future/
(6:5)StepLine:Given /they have arrived/
(7:7)TableRow://9:æ,13:o
(8:7)TableRow://9:a,13:ø
(7:7)TableRow://9:
æ
,17:\to\t
(8:7)TableRow://11:a,19:ø
(9:5)StepLine:Given /they have arrived/
(10:7)TableRow://9:|æ\n,22:\o
o\
Expand Down
4 changes: 2 additions & 2 deletions gherkin/dotnet/testdata/good/escaped_pipes.feature
Expand Up @@ -4,8 +4,8 @@ Feature: Escaped pipes

Scenario: They are the future
Given they have arrived
| æ | o |
| a | ø |
| \næ\n | \to\t |
| a | ø |
Given they have arrived
| \|æ\\n | \o\no\ |
| \\\|a\\\\n | ø\\\nø\\|
@@ -1 +1 @@
{"document":{"comments":[],"feature":{"children":[{"keyword":"Scenario","location":{"column":3,"line":5},"name":"They are the future","steps":[{"argument":{"location":{"column":7,"line":7},"rows":[{"cells":[{"location":{"column":9,"line":7},"type":"TableCell","value":"æ"},{"location":{"column":13,"line":7},"type":"TableCell","value":"o"}],"location":{"column":7,"line":7},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":8},"type":"TableCell","value":"a"},{"location":{"column":13,"line":8},"type":"TableCell","value":"ø"}],"location":{"column":7,"line":8},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":6},"text":"they have arrived","type":"Step"},{"argument":{"location":{"column":7,"line":10},"rows":[{"cells":[{"location":{"column":9,"line":10},"type":"TableCell","value":"|æ\\n"},{"location":{"column":22,"line":10},"type":"TableCell","value":"\\o\no\\"}],"location":{"column":7,"line":10},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":11},"type":"TableCell","value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"type":"TableCell","value":"ø\\\nø\\"}],"location":{"column":7,"line":11},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":9},"text":"they have arrived","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Escaped pipes","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/escaped_pipes.feature"}
{"document":{"comments":[],"feature":{"children":[{"keyword":"Scenario","location":{"column":3,"line":5},"name":"They are the future","steps":[{"argument":{"location":{"column":7,"line":7},"rows":[{"cells":[{"location":{"column":9,"line":7},"type":"TableCell","value":"\næ\n"},{"location":{"column":17,"line":7},"type":"TableCell","value":"\\to\\t"}],"location":{"column":7,"line":7},"type":"TableRow"},{"cells":[{"location":{"column":11,"line":8},"type":"TableCell","value":"a"},{"location":{"column":19,"line":8},"type":"TableCell","value":"ø"}],"location":{"column":7,"line":8},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":6},"text":"they have arrived","type":"Step"},{"argument":{"location":{"column":7,"line":10},"rows":[{"cells":[{"location":{"column":9,"line":10},"type":"TableCell","value":"|æ\\n"},{"location":{"column":22,"line":10},"type":"TableCell","value":"\\o\no\\"}],"location":{"column":7,"line":10},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":11},"type":"TableCell","value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"type":"TableCell","value":"ø\\\nø\\"}],"location":{"column":7,"line":11},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":9},"text":"they have arrived","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Escaped pipes","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/escaped_pipes.feature"}
@@ -1 +1 @@
{"pickle":{"language":"en","locations":[{"column":3,"line":5}],"name":"They are the future","steps":[{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":7},"value":"æ"},{"location":{"column":13,"line":7},"value":"o"}]},{"cells":[{"location":{"column":9,"line":8},"value":"a"},{"location":{"column":13,"line":8},"value":"ø"}]}]}],"locations":[{"column":11,"line":6}],"text":"they have arrived"},{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":10},"value":"|æ\\n"},{"location":{"column":22,"line":10},"value":"\\o\no\\"}]},{"cells":[{"location":{"column":9,"line":11},"value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"value":"ø\\\nø\\"}]}]}],"locations":[{"column":11,"line":9}],"text":"they have arrived"}],"tags":[]},"type":"pickle","uri":"testdata/good/escaped_pipes.feature"}
{"pickle":{"language":"en","locations":[{"column":3,"line":5}],"name":"They are the future","steps":[{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":7},"value":"\næ\n"},{"location":{"column":17,"line":7},"value":"\\to\\t"}]},{"cells":[{"location":{"column":11,"line":8},"value":"a"},{"location":{"column":19,"line":8},"value":"ø"}]}]}],"locations":[{"column":11,"line":6}],"text":"they have arrived"},{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":10},"value":"|æ\\n"},{"location":{"column":22,"line":10},"value":"\\o\no\\"}]},{"cells":[{"location":{"column":9,"line":11},"value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"value":"ø\\\nø\\"}]}]}],"locations":[{"column":11,"line":9}],"text":"they have arrived"}],"tags":[]},"type":"pickle","uri":"testdata/good/escaped_pipes.feature"}
@@ -1 +1 @@
{"data":"Feature: Escaped pipes\n The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.\n\n Scenario: They are the future\n Given they have arrived\n | æ | o |\n | a | ø |\n Given they have arrived\n | \\|æ\\\\n | \\o\\no\\ |\n | \\\\\\|a\\\\\\\\n | ø\\\\\\nø\\\\|\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/escaped_pipes.feature"}
{"data":"Feature: Escaped pipes\n The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.\n\n Scenario: They are the future\n Given they have arrived\n | \\næ\\n | \\to\\t |\n | a | ø |\n Given they have arrived\n | \\|æ\\\\n | \\o\\no\\ |\n | \\\\\\|a\\\\\\\\n | ø\\\\\\nø\\\\|\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/escaped_pipes.feature"}
6 changes: 4 additions & 2 deletions gherkin/dotnet/testdata/good/escaped_pipes.feature.tokens
Expand Up @@ -4,8 +4,10 @@
(4:1)Other://
(5:3)ScenarioLine:Scenario/They are the future/
(6:5)StepLine:Given /they have arrived/
(7:7)TableRow://9:æ,13:o
(8:7)TableRow://9:a,13:ø
(7:7)TableRow://9:
æ
,17:\to\t
(8:7)TableRow://11:a,19:ø
(9:5)StepLine:Given /they have arrived/
(10:7)TableRow://9:|æ\n,22:\o
o\
Expand Down
4 changes: 2 additions & 2 deletions gherkin/go/testdata/good/escaped_pipes.feature
Expand Up @@ -4,8 +4,8 @@ Feature: Escaped pipes

Scenario: They are the future
Given they have arrived
| æ | o |
| a | ø |
| \næ\n | \to\t |
| a | ø |
Given they have arrived
| \|æ\\n | \o\no\ |
| \\\|a\\\\n | ø\\\nø\\|
2 changes: 1 addition & 1 deletion gherkin/go/testdata/good/escaped_pipes.feature.ast.ndjson
@@ -1 +1 @@
{"document":{"comments":[],"feature":{"children":[{"keyword":"Scenario","location":{"column":3,"line":5},"name":"They are the future","steps":[{"argument":{"location":{"column":7,"line":7},"rows":[{"cells":[{"location":{"column":9,"line":7},"type":"TableCell","value":"æ"},{"location":{"column":13,"line":7},"type":"TableCell","value":"o"}],"location":{"column":7,"line":7},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":8},"type":"TableCell","value":"a"},{"location":{"column":13,"line":8},"type":"TableCell","value":"ø"}],"location":{"column":7,"line":8},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":6},"text":"they have arrived","type":"Step"},{"argument":{"location":{"column":7,"line":10},"rows":[{"cells":[{"location":{"column":9,"line":10},"type":"TableCell","value":"|æ\\n"},{"location":{"column":22,"line":10},"type":"TableCell","value":"\\o\no\\"}],"location":{"column":7,"line":10},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":11},"type":"TableCell","value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"type":"TableCell","value":"ø\\\nø\\"}],"location":{"column":7,"line":11},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":9},"text":"they have arrived","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Escaped pipes","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/escaped_pipes.feature"}
{"document":{"comments":[],"feature":{"children":[{"keyword":"Scenario","location":{"column":3,"line":5},"name":"They are the future","steps":[{"argument":{"location":{"column":7,"line":7},"rows":[{"cells":[{"location":{"column":9,"line":7},"type":"TableCell","value":"\næ\n"},{"location":{"column":17,"line":7},"type":"TableCell","value":"\\to\\t"}],"location":{"column":7,"line":7},"type":"TableRow"},{"cells":[{"location":{"column":11,"line":8},"type":"TableCell","value":"a"},{"location":{"column":19,"line":8},"type":"TableCell","value":"ø"}],"location":{"column":7,"line":8},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":6},"text":"they have arrived","type":"Step"},{"argument":{"location":{"column":7,"line":10},"rows":[{"cells":[{"location":{"column":9,"line":10},"type":"TableCell","value":"|æ\\n"},{"location":{"column":22,"line":10},"type":"TableCell","value":"\\o\no\\"}],"location":{"column":7,"line":10},"type":"TableRow"},{"cells":[{"location":{"column":9,"line":11},"type":"TableCell","value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"type":"TableCell","value":"ø\\\nø\\"}],"location":{"column":7,"line":11},"type":"TableRow"}],"type":"DataTable"},"keyword":"Given ","location":{"column":5,"line":9},"text":"they have arrived","type":"Step"}],"tags":[],"type":"Scenario"}],"description":" The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.","keyword":"Feature","language":"en","location":{"column":1,"line":1},"name":"Escaped pipes","tags":[],"type":"Feature"},"type":"GherkinDocument"},"type":"gherkin-document","uri":"testdata/good/escaped_pipes.feature"}
@@ -1 +1 @@
{"pickle":{"language":"en","locations":[{"column":3,"line":5}],"name":"They are the future","steps":[{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":7},"value":"æ"},{"location":{"column":13,"line":7},"value":"o"}]},{"cells":[{"location":{"column":9,"line":8},"value":"a"},{"location":{"column":13,"line":8},"value":"ø"}]}]}],"locations":[{"column":11,"line":6}],"text":"they have arrived"},{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":10},"value":"|æ\\n"},{"location":{"column":22,"line":10},"value":"\\o\no\\"}]},{"cells":[{"location":{"column":9,"line":11},"value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"value":"ø\\\nø\\"}]}]}],"locations":[{"column":11,"line":9}],"text":"they have arrived"}],"tags":[]},"type":"pickle","uri":"testdata/good/escaped_pipes.feature"}
{"pickle":{"language":"en","locations":[{"column":3,"line":5}],"name":"They are the future","steps":[{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":7},"value":"\næ\n"},{"location":{"column":17,"line":7},"value":"\\to\\t"}]},{"cells":[{"location":{"column":11,"line":8},"value":"a"},{"location":{"column":19,"line":8},"value":"ø"}]}]}],"locations":[{"column":11,"line":6}],"text":"they have arrived"},{"arguments":[{"rows":[{"cells":[{"location":{"column":9,"line":10},"value":"|æ\\n"},{"location":{"column":22,"line":10},"value":"\\o\no\\"}]},{"cells":[{"location":{"column":9,"line":11},"value":"\\|a\\\\n"},{"location":{"column":22,"line":11},"value":"ø\\\nø\\"}]}]}],"locations":[{"column":11,"line":9}],"text":"they have arrived"}],"tags":[]},"type":"pickle","uri":"testdata/good/escaped_pipes.feature"}
@@ -1 +1 @@
{"data":"Feature: Escaped pipes\n The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.\n\n Scenario: They are the future\n Given they have arrived\n | æ | o |\n | a | ø |\n Given they have arrived\n | \\|æ\\\\n | \\o\\no\\ |\n | \\\\\\|a\\\\\\\\n | ø\\\\\\nø\\\\|\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/escaped_pipes.feature"}
{"data":"Feature: Escaped pipes\n The \\-character will be considered as an escape in table cell\n iff it is followed by a |-character, a \\-character or an n.\n\n Scenario: They are the future\n Given they have arrived\n | \\næ\\n | \\to\\t |\n | a | ø |\n Given they have arrived\n | \\|æ\\\\n | \\o\\no\\ |\n | \\\\\\|a\\\\\\\\n | ø\\\\\\nø\\\\|\n","media":{"encoding":"utf-8","type":"text/x.cucumber.gherkin+plain"},"type":"source","uri":"testdata/good/escaped_pipes.feature"}
6 changes: 4 additions & 2 deletions gherkin/go/testdata/good/escaped_pipes.feature.tokens
Expand Up @@ -4,8 +4,10 @@
(4:1)Other://
(5:3)ScenarioLine:Scenario/They are the future/
(6:5)StepLine:Given /they have arrived/
(7:7)TableRow://9:æ,13:o
(8:7)TableRow://9:a,13:ø
(7:7)TableRow://9:
æ
,17:\to\t
(8:7)TableRow://11:a,19:ø
(9:5)StepLine:Given /they have arrived/
(10:7)TableRow://9:|æ\n,22:\o
o\
Expand Down