Skip to content

Add unit tests for FontVariation - #122734

Draft
zaveshaa wants to merge 1 commit into
godotengine:masterfrom
zaveshaa:test/fontvariation-unit-tests
Draft

Add unit tests for FontVariation#122734
zaveshaa wants to merge 1 commit into
godotengine:masterfrom
zaveshaa:test/fontvariation-unit-tests

Conversation

@zaveshaa

@zaveshaa zaveshaa commented Aug 23, 2026

Copy link
Copy Markdown

What problem(s) does this PR solve?

Adds unit tests for FontVariation, which currently has none (its sibling FontFile already has tests).

New file tests/scene/test_fontvariation.cpp:

  • default values
  • setters/getters round-trips, including negative values stored as-is
  • dictionary copy semantics for set_variation_opentype() / set_opentype_features()
  • extra spacing setters/getters and out-of-bounds type rejection
  • base font assignment, nested variations, reset to null

Additional information

  • No SCsub changes needed, tests/ uses a recursive glob.
  • I couldn't compile locally (Apple Clang 14, master requires 16), so CI confirmation is appreciated.
  • AI disclosure: an AI assistant helped me check API usage against current sources; test scenarios are my own.

Cover default property values, setter/getter round-trips, copy
semantics of stored dictionaries, extra spacing validation
(including out-of-bounds spacing types) and base font assignment
including nested variations.
@AThousandShips

Copy link
Copy Markdown
Member

and to draft documentation of the changes;

Please do not use AI to write PR descriptions etc.

@zaveshaa

Copy link
Copy Markdown
Author

Understood, sorry about that — I rewrote the description in plain form and will keep descriptions concise going forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants