Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slicing shall be blocked #205

Closed
HolQue opened this issue Jan 31, 2024 · 12 comments
Closed

Slicing shall be blocked #205

HolQue opened this issue Jan 31, 2024 · 12 comments

Comments

@HolQue
Copy link
Collaborator

HolQue commented Jan 31, 2024

Hi Thomas,

based on one of our latest discussions, my understanding now is that slicing shall not be supported (even in case of it's already working partially).

Therefore possibly ongoing development should be stopped.

And slicing notation inside square brackets has to cause a corresponding error message.

Reference:

#184 (comment)

@test-fullautomation
Copy link
Owner

test-fullautomation commented Jan 31, 2024

Hi Son,
as Holger writes I decided yesterday that we don't support slicing. Maybe later we will no, but not now.
Reaons:

  1. first we should be free of existing issues.
  2. rare use case
  3. much effort to stabilize (e.g. can have nested parameters, ...

So, please create an error message in case you find a slicing operator or a negative index (e.g. ${list}[-1]). Please consider that the negative index can be provided as parameter. E.g. ${list}[${index}] where the value behind ${index} is negative.

Positive operator ${list}[+1] must be allowed. Currently there is a bug. This causes that the whole expression is not resolved.

Thank you,
Thomas

@test-fullautomation test-fullautomation added this to the 0.11.0 milestone Jan 31, 2024
@test-fullautomation test-fullautomation changed the title Slicing shall not be supported Slicing shall be blocked Jan 31, 2024
@HolQue
Copy link
Collaborator Author

HolQue commented Mar 20, 2024

Self test: added JPP_1350 - JPP_1364 (topic: slicing; tests commented out)

@namsonx
Copy link
Collaborator

namsonx commented Mar 22, 2024

Hello Holger, Hello Thomas,

I created the commit 48eae0f0df on stabi branch.

I aslo enabled the 2 test cases JPP_1350 - JPP_1364

Thank you,
Son

@HolQue
Copy link
Collaborator Author

HolQue commented Mar 22, 2024

Hi Son,

in one of my commits I wrote: "JPP_1350 - JPP_1364". And the meaning of this is: "from JPP_1350 to JPP_1364", and not: "JPP_1350 and JPP_1364".

All further test cases between 1650 and 1364 are still commented out - and cause errors when I activate them.

But to fix the remaining aspects is for 0.12.x.

@HolQue
Copy link
Collaborator Author

HolQue commented Mar 22, 2024

Example:

'Expression '${listParam}[:]' cannot be evaluated. Reason: Empty or special character is detected in pair of square brackets.'

Expected: Slicing is not supported

"testParam" : {"key" : ${listParam}[:]}

still causes

Expecting ',' delimiter: line 5 column 1 (char 75)'

@namsonx
Copy link
Collaborator

namsonx commented Apr 8, 2024

Hello Holger,

All blocked slicing's test cases are uncovered and tested successful.

Thank you,
Son

@HolQue
Copy link
Collaborator Author

HolQue commented Apr 9, 2024

Hi Son,

please keep in mind that there is at least one error message active that mentions the possibility to use slices:

'Could not set variable '${testlist}['${intval}']' with value '4'! Reason: list indices must be integers or slices, not str'

That is misleading for the audience, because slicing shall be blocked. In this case you cannot take over the error message from Python.

@namsonx
Copy link
Collaborator

namsonx commented Apr 22, 2024

Hello Holger,

Could you please check error message again, I updated error message as Thomas' suggestion: #186 (comment)

Thank you,
Son

@HolQue
Copy link
Collaborator Author

HolQue commented May 7, 2024

Hi Son,

I still get this error message with slicing proposed:

Error: 'Could not set variable '${listP}['${indexP}']' with value 'newvalue'! Reason: list indices must be integers or slices, not str'!

But "or slices" is not expected.

@namsonx
Copy link
Collaborator

namsonx commented May 14, 2024

Hello Holger,

I updated error message in this case.

Thank you,
Son

@HolQue
Copy link
Collaborator Author

HolQue commented May 15, 2024

Retest successful. Issue can be closed.

@test-fullautomation
Copy link
Owner

Released with RobotFramework AIO 0.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants