Skip to content

Commit b82f289

Browse files
committed
For loop syntax enhancements.
1. `FOR` (case-sensitive) is enough as a for loop marker. Old `:FOR` is not deprecated but that will be eventually done. Fixes robotframework#2990. 2. For loop separators `IN`, `IN RANGE`, `IN ENUMERARE` and `IN ZIP` are now case-sensitive and using them case-insensitively is deprecated. Fixes robotframework#2991.
1 parent 8ffae8f commit b82f289

File tree

8 files changed

+206
-146
lines changed

8 files changed

+206
-146
lines changed

atest/robot/cli/rebot/remove_keywords/combinations.robot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Resource remove_keywords_resource.robot
55

66
*** Test Cases *** rem1 rem2 etc.
77

8-
Rational FOR WUKS
8+
Rational \FOR WUKS
99
PASSED FOR
1010
PASSED WUKS
1111
PASSED WUKS FOR

atest/robot/running/for.robot

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,34 @@ For In Range With Wrong Number Of Variables
342342
For In Range With Non-Existing Variables In Arguments
343343
Check Test Case ${TEST NAME}
344344

345-
For loops are case and space insensitive
345+
For loop marker with colon still works
346346
Check Test Case ${TEST NAME}
347347

348-
For word can have many colons
348+
For loop marker with colon is case and space insensitive
349349
Check Test Case ${TEST NAME}
350350

351+
For loop marker can have many colons
352+
Check Test Case ${TEST NAME}
353+
354+
Case and space insensitive for loop separator is deprecated
355+
Check Test Case ${TEST NAME}
356+
${path} = Normalize Path ${DATADIR}/running/for.robot
357+
${message} = Catenate
358+
... Error in file '${path}':
359+
... Invalid syntax in test case '${TEST NAME}':
360+
... Using 'in' as a FOR loop separator is deprecated. Use 'IN' instead.
361+
Check log message ${ERRORS}[0] ${message} WARN
362+
${message} = Catenate
363+
... Error in file '${path}':
364+
... Invalid syntax in test case '${TEST NAME}':
365+
... Using 'INRANGE' as a FOR loop separator is deprecated. Use 'IN RANGE' instead.
366+
Check log message ${ERRORS}[1] ${message} WARN
367+
${message} = Catenate
368+
... Error in file '${path}':
369+
... Invalid syntax in test case '${TEST NAME}':
370+
... Using 'I ne numer ate' as a FOR loop separator is deprecated. Use 'IN ENUMERATE' instead.
371+
Check log message ${ERRORS}[2] ${message} WARN
372+
351373
*** Keywords ***
352374
Should Be For Keyword
353375
[Arguments] ${kw} ${subcount}

0 commit comments

Comments
 (0)