Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #159 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 2358 2443 +85
=========================================
+ Hits 2358 2443 +85 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
def test_dont_change_arg1_value_from_x_to_y():
t = Template('{{t|x|1=y|1=x}}')
t.rm_dup_args_safe()
assert t.string == '{{t|1=y|1=x}}'currently it gets converted to In this case |
|
@5j9 Perhaps checking instead if semantics will change after argument removal and not doing anything at all? What about |
|
That would be fine if no better approach can be found. Although I think in my test case, We could also merge it as is and leave that test case for another issue. |
|
@5j9 I modified the code to address both cases. I think it is only necessary to check when the current argument is positional, since it is the situation where are removed the previous arguments. Of course, semantics will be changed if the argument is empty, but that is how the function worked before. You may merge now and close the associated issues. |
|
Merged into main locally after rebasing the PR branch. Closing manually since GitHub did not detect the rebased commits as a merge. |
@5j9 As we were discussing in the issues:
rm_dup_args_safeandrm_first_of_dup_argsshift positional arguments. Changed the implementation to forbid this breakage of semantics.endswithJust for historic reasons I reverse iterated, but I think my new implementation of
rm_dup_args_safecan work also with forward iteration. Feel free to add all the test you consider neccesary.