-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feat/add comments #555
Feat/add comments #555
Conversation
I've noticed something else that might have to be accounted for. In th global test a description is used. Like the following: - tab: "Global variable"
testcases:
- expression: "GLOBAL_VAR # The name of the global variable"
return: "GLOBAL"
description:
description: "Hallo"
format: "code" Instead of getting: {"description": {"description": "GLOBAL_VAR # The name of the global variable", "format": "code"}, "command": "start-testcase"} I get the following instead: {"description": {"description": "Hallo # The name of the global variable", "format": "code"}, "command": "start-testcase"} Is this the desired outcome or do we want to turn line-comments off in those cases? |
I think we only want the comment if it is in the |
I'm not sure I'm following. So when comments are in a statement/expression and there is no description, we keep those comment? If there is a desciption we take the comment from that? |
Added the ability to add comment to a description too. When a comment is present in the expression, it will be ignored and the comment in the description will be used. However I'm not sure if the description is always valid to be parsed by the tokenizer. description:
description: "Hallo"
format: "code"
comment: "This is a greeting" Right now it simply like this: description:
description: "Hallo # This is a greeting"
format: "code" |
Comment can now only put at the end of statements/expressions. Statements and Expressions in the in the TESTed-DSL should only be 1 line so comments in between lines like the on below are irrelevant.
Furthermore, block-comment don't need to be supported by TESTed either. Some Languages might not even support it. When a description is present, the comments from the corresponding expression should not be pasted over. You should write the comments yourself. The description is never parsed so you can use whatever symbol you want to start a comment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no other comments that Jorg hasn't said already
Just for verification: do we avoid the tokenization step and passing the comment string to the |
That is an oversight on my part. Adding a small check for that would be much better. Right now, it's just not adding the comment when generating the output. This should be an easy fix. |
Thanks for your work on this! Looks good |
Issue #371
Adding line comments for statements and expressions.
Example:
Test suite:
Output: