Compare two sets as a library function and a command - #85
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tests/test_against_convert.py holds the comparison of two sets - question by question, part by part, main text, part text and worked solution, with whitespace runs folded, image references compared by file name and a lone empty part dropped - and the differs.txt convention that records known differences per folder. The agent needs the same comparison to check a built set against the Lambda Feedback export it should reproduce, so it belongs in the package.
Move it into
in2lambda.compare:differences(built: Set, expected: Set) -> list[str]returning the lines the test now builds (Question 1 "", part (a), worked solution: the draft says ... and convert says ..., with the two sides named by argumentsleft_name/right_namedefaulting to "the draft" and "convert"), andknown(path) -> list[str]reading a differs.txt with# ticketcomments. Keep the normalisation rules as they are and document them in the module docstring; tests/test_against_convert.py imports both and loses its private copies. Addin2lambda compare BUILT_ZIP EXPORT_DIR [--known differs.txt]to the CLI, printing each difference and exiting 1 where the differences are not exactly the known ones, so a person can compare a set with an export by hand. A unit test in tests/test_compare.py covers the three normalisations and the known-differences check with two small sets built in the test. Done when the against-convert suite passes unchanged in outcome and the CLI compares the ME2 export fixture with itself as identical.Workbench ticket t55.