Skip to content

Commit

Permalink
fix:regression on assert == step definition
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Carisey <[email protected]>
  • Loading branch information
scarisey committed Nov 6, 2024
1 parent 0334765 commit c8ef3e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class FeaturesStepDefinitions
}

// ASSERT
And("^assert\\s+(\\S+)\\s+(\\S+)\\s*==\\s*([^+-]*)\\s*$") {
And("""^assert\s+(\S+)\s+(\S+)\s*==(?!\s+(?:[+-.eE0-9]+)\s+\+\-\s+(?:[+-.eE0-9]+)\s*)(?:\s*)(.*)(?:\s*)$""") {
(alias: String, jsonExpression: String, expected: String) =>
logger.debug(
s"Assert Step : (alias,jsonExpression,expected) ($alias,$jsonExpression,$expected)"
Expand Down
2 changes: 2 additions & 0 deletions src/test/resources/features/assertions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Feature: assertions
And assert value2.2 $ has size 2
And assert value2.2 $ == [3,4]
And assert value2.3 $ == "value2.3"
And assert value2.4 $.bar == "2020-09-09T10:49:25.871365100"
And assert value2.4 $.baz == "42.0 +- 0.1"
And assert value2.4 $.foo == 12.0038209653823934567890123456789
And assert value2.4 $.foo == 12.0 +- 0.1
And assert value2.4 $.foo == 12.1 +- 0.1
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/features/records/keyheadersvalue.dat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
key1_${uuid}#{"qux":42}#{"foo":"bar","baz":42}
key2_${uuid}#[3,4]#{"foo":"bar","baz":[1,2]}
key3_${uuid}#value2.3#{"foo":"bar"}
key4_${uuid}#{"foo":12.0038209653823934567890123456789}#{"foo":"bar"}
key4_${uuid}#{"foo":12.0038209653823934567890123456789,"bar":"2020-09-09T10:49:25.871365100","baz":"42.0 +- 0.1"}#{"foo":"bar"}

0 comments on commit c8ef3e3

Please sign in to comment.