Skip to content

test: fix synfig::filesystem::Path test for compare method - #3671

Merged
Svarov-RZM merged 1 commit into
synfig:masterfrom
rodolforg:fix-filesystem-path-tests
Jan 28, 2026
Merged

Svarov-RZM merged 1 commit into
synfig:masterfrom
rodolforg:fix-filesystem-path-tests

Conversation

@rodolforg

@rodolforg rodolforg commented Jan 18, 2026 •

Copy link
Copy Markdown
Contributor

compare() returns 0, negative or positive integer, not fixed to 0, -1 or 1.

Added some minor tests here too.

Detected via Debian Package Auto-Building:
https://buildd.debian.org/status/logs.php?suite=sid&arch=s390x&pkg=synfig&ver=1.5.3%2Bdfsg-1

(check "Maybe-Failed" link)

compare() returns 0, negative or positive integer, not fixed
to 0, -1 or 1.

Added some minor tests here too.

Detected via Debian Package Auto-Building:
https://buildd.debian.org/status/logs.php?suite=sid&arch=s390x&pkg=synfig&ver=1.5.3%2Bdfsg-1
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @rodolforg, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the test suite for the synfig::filesystem::Path::compare() method. It addresses an inaccuracy where existing tests incorrectly assumed fixed return values of -1 or 1, while the method's contract allows for any negative or positive integer to indicate less than or greater than. The changes update these assertions to correctly validate the comparison logic and include a few additional test cases for robustness.

Highlights

  • Test Correction: Corrected synfig::filesystem::Path::compare() method tests to account for its return value being any negative or positive integer, not just -1 or 1.
  • Assertion Update: Replaced ASSERT_EQUAL(-1, ...) and ASSERT_EQUAL(1, ...) with ASSERT(0 > ...) and ASSERT(0 < ...) respectively, to accurately reflect the comparison method's behavior.
  • New Test Cases: Added minor additional test cases to improve coverage for the compare method, specifically for paths with different last components.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@github-actions

Copy link
Copy Markdown

Thank you for contributing!
Below is how your contribution will appear in Synfig's release notes. Review it and improve your pull request's title and description so that your contribution is clear. You can add images, videos, and anything else you want. Have fun!

✔️ Tests

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes a bug in the synfig::filesystem::Path test for the compare method, where the test was making an incorrect assumption about the return value. The fix to check for negative/positive values instead of specific -1/1 is correct. I also appreciate the addition of more test cases for paths with and without trailing slashes, which improves test coverage and consistency. The changes are clear, correct, and well-implemented.

@github-actions

Copy link
Copy Markdown

Thank you for attempting to improve your contribution description!
Below is how your updated contribution will appear in Synfig's release notes. Review it and make further improvements until you're satisfied!

✔️ Tests

@Svarov-RZM
Svarov-RZM merged commit 7e64a2b into synfig:master Jan 28, 2026
@Svarov-RZM

Copy link
Copy Markdown
Contributor

Merged, thank you.

@rodolforg
rodolforg deleted the fix-filesystem-path-tests branch January 29, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants