I miss sets when I write Robot Framework tests. I tried to emulate what I need like this:
Create Set
[arguments] @{elements}
${set}= Evaluate {e for e in @{elements}}
[return] ${set}
Sets Should Be Equal
[arguments] ${a} ${b}
${equal} Evaluate set(@{a}) == set(@{b})
Should Be True ${equal}
Append to Set
[arguments] ${set} ${new}
Evaluate ${set}.add(${new})
The two first keywords are fine, it seems.
Append to Set does not work, ${new} never gets added to the set. My guess is that the keyword is working on a copy, and since set.add returns None, the copy gets discarded with no effect.
I've tried to return ${set} from the keyword, and save the result from the keyword call, to no effect.
robot-log.html looks like this for Create Set (working):
and like this for Append to Set (not working):
I can I modify the set passed as argument?
Another issue is that Append to Set requires quoting the new argument, while Create Set does not.

