Closed liangyuanpeng closed 1 week ago
It's not clear what the cause of this problem is, but I hope the tests will cover it. cc @He1pa @Peefy PTAL,Thanks.
It's not clear what the cause of this problem is, but I hope the tests will cover it. cc @He1pa @Peefy PTAL,Thanks.
I have found the error. It should be that lazy eval repeatedly executes the if statement when calculating _nodes. Im trying to fix it.
@He1pa I just noted that https://github.com/kcl-lang/kcl/pull/1418 is merged and then i rebase main here, seems like it's still failing.
Testing /home/runner/work/kcl/kcl/test/grammar/if/if_stmt/test_5
STDOUT:
Condition is true.
Condition is true.
nodes: []
STDERR:
Hello @liangyuanpeng Fixed in #1418 and #1423.
You can rebase the main branch, and update the test case to
_nodes=[]
if True:
print("Condition: True") # Use the right YAML form
elif False:
_nodes+=[]
nodes=_nodes
Hi @Peefy Thanks for your quickly reply and work for it!
rebased main.
I have not get that why it's need to use the yaml data, In the real world, this is how people actually use it. Is this due to test case limitations?
-- print("Condition is true.")
++ print("Condition: True") # Use the right YAML form
Hello @liangyuanpeng
At present, KCL's e2e testing only recognizes legitimate YAML data, which is different from real-world cases.
Thank you for your clarification, updated
Totals | |
---|---|
Change from base Build 9594420056: | 0.0% |
Covered Lines: | 55602 |
Relevant Lines: | 78012 |
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Totals | |
---|---|
Change from base Build 9594420056: | 0.0% |
Covered Lines: | 55602 |
Relevant Lines: | 78012 |
Releated https://github.com/kcl-lang/kcl/issues/1410 Add a new test case for if.
1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):
2. What is the scope of this PR (e.g. component or file name):
3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):
4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):
5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links: