You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1269,13 +1269,13 @@ And functions work as well ! You can imagine how you could evolve a nice set of
1269
1269
* match date == { month: '#? isValidMonth(_)' }
1270
1270
```
1271
1271
1272
-
Especially since strings can be easily coerced to numbers (and vice-versa) in Javascript, you can combine built-in validators with the self-valildation 'predicate' form as follows:
1272
+
Especially since strings can be easily coerced to numbers (and vice-versa) in Javascript, you can combine built-in validators with the self-valildation 'predicate' form like this: `'#number? _ > 0'`
1273
1273
```cucumber
1274
1274
# given this invalid input (string instead of number)
1275
1275
* def date = { month: '3' }
1276
1276
# this will pass
1277
1277
* match date == { month: '#? _ > 0' }
1278
-
# but this won't
1278
+
# but this 'combined form' will fail, which is what we want
0 commit comments