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
{{ message }}
Repository navigation
Using scalar variables as list variables is allowed #483
It would be convenient to be able to use scalar variables containing lists
(or any other iterable) as list variables. It has been possible to use
lists as scalars already some time ( issue 117 ).
If variables can be used as scalars or lists based on needs we don't need
to differentiate them when storing, which will make the implementation
cleaner. The only problem is that it's currently possible to have list and
scalar variables with the same basename (e.g. ${FOO} and @⁠{FOO}), so we
need to deprecate that first.
I do not agree on the need to deprecate simultaneous usage of list and scalar variable with same basename. This has been a problem already before this feature.
Fixed some problems in the original implementation:
Added support for extended variable syntax. For example, '@{EXTENDED.list}' now works if '${EXTENDED}' exists and contains 'list' attribute with a list value.
Error when using a scalar variable containing non-list (e.g. '@{TESTNAME}') is reported separately, not with normal "Non-existing variable ..." error.
Also fixed some issues with tests:
3) Moved them from core top level suite to variables.
4) Removed tests not related to using scalars as lists (tested elsewhere in variables suite) and renamed suite accordingly.
5) Changed extension from *.robot to *.txt.
Activity
spooning commentedon Jun 29, 2014
Fixed after r903bfab954bc
spooning commentedon Jun 29, 2014
Still needs modification to the User Guide.
I do not agree on the need to deprecate simultaneous usage of list and scalar variable with same basename. This has been a problem already before this feature.
spooning commentedon Jun 29, 2014
Updated User Guide in r30a3df1e2df7.
spooning commentedon Jun 29, 2014
I agree that this issue is independent on deprecating using scalar and list variables with same name.
I have been reviewing the code and tests and noticed few issues worth fixing. I'll do that first and then take a look at the docs.
spooning commentedon Jun 29, 2014
This issue was updated by revision 21b2640cafdd.
Fixed some problems in the original implementation:
Also fixed some issues with tests:
3) Moved them from core top level suite to variables.
4) Removed tests not related to using scalars as lists (tested elsewhere in variables suite) and renamed suite accordingly.
5) Changed extension from *.robot to *.txt.
spooning commentedon Jun 29, 2014
This issue was updated by revision d4722c593cc5.
Did some enhancements to documentation:
spooning commentedon Jun 29, 2014
Mikko, can you take a look at the changes I've done? Please close this issue if everything looks good and let me know if you find something weird.
Enhanced docs mentioned in the previous comment are visible online here:
http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUserGuide.html#using-list-variables-as-scalars
spooning commentedon Jun 29, 2014
Seems ok.
Closing this issue.