@@ -834,18 +834,14 @@ Using variables with custom embedded argument regular expressions
834
834
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
835
835
836
836
When using embedded arguments with custom regular expressions, specifying
837
- values using values has certain limitations. Variables work fine if
838
- they match the whole embedded argument, but not if the value contains
839
- a variable with any additional content. For example, the first test below
840
- succeeds because the variable `${DATE} ` matches the argument `${date} ` fully,
841
- but the second test fails because `${YEAR}-${MONTH}-${DAY} ` is not a single
842
- variable.
837
+ values using variables works only if variables match the whole embedded
838
+ argument, not if there is any additional content with the variable.
839
+ For example, the first test below succeeds because the variable `${DATE} `
840
+ is used on its own, but the last test fails because `${YEAR}-${MONTH}-${DAY} `
841
+ is not a single variable.
843
842
844
843
.. sourcecode :: robotframework
845
844
846
- *** Settings * **
847
- Library DateTime
848
-
849
845
*** Variables * **
850
846
${DATE} 2011-06-27
851
847
${YEAR} 2011
@@ -856,17 +852,15 @@ variable.
856
852
Succeeds
857
853
Deadline is ${DATE}
858
854
855
+ Succeeds without variables
856
+ Deadline is 2011-06-27
857
+
859
858
Fails
860
859
Deadline is ${YEAR}-${MONTH}-${DAY}
861
860
862
861
*** Keywords * **
863
- Deadline is ${date:(\d {4}-\d {2}-\d {2}|today)}
864
- IF '${date}' == 'today'
865
- ${date} = Get Current Date
866
- ELSE
867
- ${date} = Convert Date ${date}
868
- END
869
- Log Deadline is on ${date}.
862
+ Deadline is ${date:\d {4}-\d {2}-\d {2}}
863
+ Log Deadline is ${date}
870
864
871
865
Another limitation of using variables is that their actual values are not matched
872
866
against custom regular expressions. As the result keywords may be called with
0 commit comments