steam: harden VDF parser & library detection; add tests#6
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.
Motivation
libraryfoldersentries or theirappschild are not maps.Description
vdf::Parser::parse_mapby removing thefound_closing_braceflag and returning early on EOF or closing-brace conditions, making the control flow clearer (src/steam/vdf.rs).if kind_found {}block and tightened the conditional branches indetect_games_from_parsed_vdfsto only log when nothing was found and otherwise dedupe inaccessible entries (src/steam/library.rs).test_find_game_skips_non_map_library_entriesandtest_find_game_skips_non_map_appsto ensure such entries are safely ignored (src/steam/library.rs).Testing
cargo fmt --allwhich completed successfully.cargo test -qbut the test run failed in this environment becauseglib-2.0development pkg-config metadata is missing, soglib-syscannot build and the full test suite could not be executed.PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig cargo test -qwhich failed with the same missingglib-2.0.pcblocker; the new tests are present in the tree and should pass when system dev deps are available.Codex Task