Skip to content

Commit

Permalink
WIP [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
50U10FCA7 committed Sep 20, 2023
1 parent 2722167 commit abcaef0
Show file tree
Hide file tree
Showing 79 changed files with 541 additions and 45 deletions.
5 changes: 5 additions & 0 deletions tests/features/output/.feature.basic.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Feature: output
Scenario: output
✔ Given foo is 0
✔ When foo is 1
✔ Then foo is 2
8 changes: 8 additions & 0 deletions tests/features/output/.feature.colored.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Feature: output
 Scenario: output
Given foo is 0
 ✔ Given foo is 0
When foo is 1
 ✔ When foo is 1
Then foo is 2
 ✔ Then foo is 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ Feature(Feature { keyword: "Feature", name: "output", description: None, backgro
Feature(Feature { keyword: "Feature", name: "output", description: None, background: None, scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0", docstring: None, table: None, position: LineCol { line: 3 } }, Step { keyword: "When ", ty: When, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 4 } }, Step { keyword: "Then ", ty: Then, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 5 } }], examples: [], tags: [], position: LineCol { line: 2 } }], rules: [], tags: [], position: LineCol { line: 1 }, }, Scenario(Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0", docstring: None, table: None, position: LineCol { line: 3 } }, Step { keyword: "When ", ty: When, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 4 } }, Step { keyword: "Then ", ty: Then, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 5 } }], examples: [], tags: [], position: LineCol { line: 2 } }, RetryableScenario { event: Step(Step { keyword: "Then ", ty: Then, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 5 } }, Passed(CaptureLocations(Captures { pid: Some(PatternID(0)), spans: {0: 0..8, 1: 7..8} }), Some(Location { line: 15, column: 1 }))), retries: None }))
Feature(Feature { keyword: "Feature", name: "output", description: None, background: None, scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0", docstring: None, table: None, position: LineCol { line: 3 } }, Step { keyword: "When ", ty: When, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 4 } }, Step { keyword: "Then ", ty: Then, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 5 } }], examples: [], tags: [], position: LineCol { line: 2 } }], rules: [], tags: [], position: LineCol { line: 1 }, }, Scenario(Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0", docstring: None, table: None, position: LineCol { line: 3 } }, Step { keyword: "When ", ty: When, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 4 } }, Step { keyword: "Then ", ty: Then, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 5 } }], examples: [], tags: [], position: LineCol { line: 2 } }, RetryableScenario { event: Finished, retries: None }))
Feature(Feature { keyword: "Feature", name: "output", description: None, background: None, scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0", docstring: None, table: None, position: LineCol { line: 3 } }, Step { keyword: "When ", ty: When, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 4 } }, Step { keyword: "Then ", ty: Then, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 5 } }], examples: [], tags: [], position: LineCol { line: 2 } }], rules: [], tags: [], position: LineCol { line: 1 }, }, Finished)
Finished
Finished
8 changes: 8 additions & 0 deletions tests/features/output/ambiguous_step.feature.basic.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Feature: ambiguous
Scenario: ambiguous
✘ Given foo is 0 ambiguous
Step failed:
Defined: tests/features/output/ambiguous_step.feature:3:5
Step match is ambiguous: Possible matches:
foo is (\d+) ambiguous --> tests/output.rs:21:1
foo is (\d+) --> tests/output.rs:13:1
9 changes: 9 additions & 0 deletions tests/features/output/ambiguous_step.feature.colored.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Feature: ambiguous
 Scenario: ambiguous
Given foo is 0 ambiguous
 ✘ Given foo is 0 ambiguous
Step failed:
Defined: tests/features/output/ambiguous_step.feature:3:5
Step match is ambiguous: Possible matches:
foo is (\d+) --> tests/output.rs:13:1
foo is (\d+) ambiguous --> tests/output.rs:21:1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Feature(Feature { keyword: "Feature", name: "ambiguous", description: None, back
Feature(Feature { keyword: "Feature", name: "ambiguous", description: None, background: None, scenarios: [Scenario { keyword: "Scenario", name: "ambiguous", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0 ambiguous", docstring: None, table: None, position: LineCol { line: 3 } }], examples: [], tags: [], position: LineCol { line: 2 } }], rules: [], tags: [], position: LineCol { line: 1 }, }, Scenario(Scenario { keyword: "Scenario", name: "ambiguous", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0 ambiguous", docstring: None, table: None, position: LineCol { line: 3 } }], examples: [], tags: [], position: LineCol { line: 2 } }, RetryableScenario { event: Step(Step { keyword: "Given ", ty: Given, value: "foo is 0 ambiguous", docstring: None, table: None, position: LineCol { line: 3 } }, Failed(None, None, None, AmbiguousMatch(AmbiguousMatchError { possible_matches: [(HashableRegex(Regex("foo is (\\d+)")), Some(Location { line: 13, column: 1 })), (HashableRegex(Regex("foo is (\\d+) ambiguous")), Some(Location { line: 21, column: 1 }))] }))), retries: None }))
Feature(Feature { keyword: "Feature", name: "ambiguous", description: None, background: None, scenarios: [Scenario { keyword: "Scenario", name: "ambiguous", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0 ambiguous", docstring: None, table: None, position: LineCol { line: 3 } }], examples: [], tags: [], position: LineCol { line: 2 } }], rules: [], tags: [], position: LineCol { line: 1 }, }, Scenario(Scenario { keyword: "Scenario", name: "ambiguous", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0 ambiguous", docstring: None, table: None, position: LineCol { line: 3 } }], examples: [], tags: [], position: LineCol { line: 2 } }, RetryableScenario { event: Finished, retries: None }))
Feature(Feature { keyword: "Feature", name: "ambiguous", description: None, background: None, scenarios: [Scenario { keyword: "Scenario", name: "ambiguous", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0 ambiguous", docstring: None, table: None, position: LineCol { line: 3 } }], examples: [], tags: [], position: LineCol { line: 2 } }], rules: [], tags: [], position: LineCol { line: 1 }, }, Finished)
Finished
Finished
7 changes: 7 additions & 0 deletions tests/features/output/background_rule.feature.basic.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Feature: output
Rule: output
Scenario: output
✔> Given foo is 0
✔ Given foo is 1
✔ When foo is 2
✔ Then foo is 3
11 changes: 11 additions & 0 deletions tests/features/output/background_rule.feature.colored.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Feature: output
Rule: output
 Scenario: output
> Given foo is 0
 ✔> Given foo is 0
Given foo is 1
 ✔ Given foo is 1
When foo is 2
 ✔ When foo is 2
Then foo is 3
 ✔ Then foo is 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Feature(Feature { keyword: "Feature", name: "output", description: None, backgro
Feature(Feature { keyword: "Feature", name: "output", description: None, background: Some(Background { keyword: "Background", name: "", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0", docstring: None, table: None, position: LineCol { line: 4 } }], position: LineCol { line: 3 } }), scenarios: [], rules: [Rule { keyword: "Rule", name: "output", description: None, background: None, scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 9 } }, Step { keyword: "When ", ty: When, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 10 } }, Step { keyword: "Then ", ty: Then, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 11 } }], examples: [], tags: [], position: LineCol { line: 8 } }], tags: [], position: LineCol { line: 6 } }], tags: [], position: LineCol { line: 1 }, }, Rule(Rule { keyword: "Rule", name: "output", description: None, background: None, scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 9 } }, Step { keyword: "When ", ty: When, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 10 } }, Step { keyword: "Then ", ty: Then, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 11 } }], examples: [], tags: [], position: LineCol { line: 8 } }], tags: [], position: LineCol { line: 6 } }, Scenario(Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 9 } }, Step { keyword: "When ", ty: When, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 10 } }, Step { keyword: "Then ", ty: Then, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 11 } }], examples: [], tags: [], position: LineCol { line: 8 } }, RetryableScenario { event: Finished, retries: None })))
Feature(Feature { keyword: "Feature", name: "output", description: None, background: Some(Background { keyword: "Background", name: "", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0", docstring: None, table: None, position: LineCol { line: 4 } }], position: LineCol { line: 3 } }), scenarios: [], rules: [Rule { keyword: "Rule", name: "output", description: None, background: None, scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 9 } }, Step { keyword: "When ", ty: When, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 10 } }, Step { keyword: "Then ", ty: Then, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 11 } }], examples: [], tags: [], position: LineCol { line: 8 } }], tags: [], position: LineCol { line: 6 } }], tags: [], position: LineCol { line: 1 }, }, Rule(Rule { keyword: "Rule", name: "output", description: None, background: None, scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 9 } }, Step { keyword: "When ", ty: When, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 10 } }, Step { keyword: "Then ", ty: Then, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 11 } }], examples: [], tags: [], position: LineCol { line: 8 } }], tags: [], position: LineCol { line: 6 } }, Finished))
Feature(Feature { keyword: "Feature", name: "output", description: None, background: Some(Background { keyword: "Background", name: "", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0", docstring: None, table: None, position: LineCol { line: 4 } }], position: LineCol { line: 3 } }), scenarios: [], rules: [Rule { keyword: "Rule", name: "output", description: None, background: None, scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 9 } }, Step { keyword: "When ", ty: When, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 10 } }, Step { keyword: "Then ", ty: Then, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 11 } }], examples: [], tags: [], position: LineCol { line: 8 } }], tags: [], position: LineCol { line: 6 } }], tags: [], position: LineCol { line: 1 }, }, Finished)
Finished
Finished
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Feature: output
Rule: output
Scenario: output
✔> Given foo is 0
✔> Given foo is 1
✔ Given foo is 2
✔ When foo is 3
✔ Then foo is 4
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Feature: output
Rule: output
 Scenario: output
> Given foo is 0
 ✔> Given foo is 0
> Given foo is 1
 ✔> Given foo is 1
Given foo is 2
 ✔ Given foo is 2
When foo is 3
 ✔ When foo is 3
Then foo is 4
 ✔ Then foo is 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Feature(Feature { keyword: "Feature", name: "output", description: None, backgro
Feature(Feature { keyword: "Feature", name: "output", description: None, background: Some(Background { keyword: "Background", name: "", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0", docstring: None, table: None, position: LineCol { line: 4 } }], position: LineCol { line: 3 } }), scenarios: [], rules: [Rule { keyword: "Rule", name: "output", description: None, background: Some(Background { keyword: "Background", name: "", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 9 } }], position: LineCol { line: 8 } }), scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 12 } }, Step { keyword: "When ", ty: When, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 13 } }, Step { keyword: "Then ", ty: Then, value: "foo is 4", docstring: None, table: None, position: LineCol { line: 14 } }], examples: [], tags: [], position: LineCol { line: 11 } }], tags: [], position: LineCol { line: 6 } }], tags: [], position: LineCol { line: 1 }, }, Rule(Rule { keyword: "Rule", name: "output", description: None, background: Some(Background { keyword: "Background", name: "", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 9 } }], position: LineCol { line: 8 } }), scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 12 } }, Step { keyword: "When ", ty: When, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 13 } }, Step { keyword: "Then ", ty: Then, value: "foo is 4", docstring: None, table: None, position: LineCol { line: 14 } }], examples: [], tags: [], position: LineCol { line: 11 } }], tags: [], position: LineCol { line: 6 } }, Scenario(Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 12 } }, Step { keyword: "When ", ty: When, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 13 } }, Step { keyword: "Then ", ty: Then, value: "foo is 4", docstring: None, table: None, position: LineCol { line: 14 } }], examples: [], tags: [], position: LineCol { line: 11 } }, RetryableScenario { event: Finished, retries: None })))
Feature(Feature { keyword: "Feature", name: "output", description: None, background: Some(Background { keyword: "Background", name: "", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0", docstring: None, table: None, position: LineCol { line: 4 } }], position: LineCol { line: 3 } }), scenarios: [], rules: [Rule { keyword: "Rule", name: "output", description: None, background: Some(Background { keyword: "Background", name: "", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 9 } }], position: LineCol { line: 8 } }), scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 12 } }, Step { keyword: "When ", ty: When, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 13 } }, Step { keyword: "Then ", ty: Then, value: "foo is 4", docstring: None, table: None, position: LineCol { line: 14 } }], examples: [], tags: [], position: LineCol { line: 11 } }], tags: [], position: LineCol { line: 6 } }], tags: [], position: LineCol { line: 1 }, }, Rule(Rule { keyword: "Rule", name: "output", description: None, background: Some(Background { keyword: "Background", name: "", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 9 } }], position: LineCol { line: 8 } }), scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 12 } }, Step { keyword: "When ", ty: When, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 13 } }, Step { keyword: "Then ", ty: Then, value: "foo is 4", docstring: None, table: None, position: LineCol { line: 14 } }], examples: [], tags: [], position: LineCol { line: 11 } }], tags: [], position: LineCol { line: 6 } }, Finished))
Feature(Feature { keyword: "Feature", name: "output", description: None, background: Some(Background { keyword: "Background", name: "", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 0", docstring: None, table: None, position: LineCol { line: 4 } }], position: LineCol { line: 3 } }), scenarios: [], rules: [Rule { keyword: "Rule", name: "output", description: None, background: Some(Background { keyword: "Background", name: "", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 1", docstring: None, table: None, position: LineCol { line: 9 } }], position: LineCol { line: 8 } }), scenarios: [Scenario { keyword: "Scenario", name: "output", description: None, steps: [Step { keyword: "Given ", ty: Given, value: "foo is 2", docstring: None, table: None, position: LineCol { line: 12 } }, Step { keyword: "When ", ty: When, value: "foo is 3", docstring: None, table: None, position: LineCol { line: 13 } }, Step { keyword: "Then ", ty: Then, value: "foo is 4", docstring: None, table: None, position: LineCol { line: 14 } }], examples: [], tags: [], position: LineCol { line: 11 } }], tags: [], position: LineCol { line: 6 } }], tags: [], position: LineCol { line: 1 }, }, Finished)
Finished
Finished
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Feature: Outline
Rule: outline
Scenario Outline: foo 2
✔> Given foo is 0
✔> Given foo is 1
✔ Given foo is 2
✔ When foo is 3
✔ Then foo is 4
Loading

0 comments on commit abcaef0

Please sign in to comment.