Skip to content

test: 🧪 added tests for .process_script() #476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jan 26, 2025

Conversation

KANAjetzt
Copy link
Member

@KANAjetzt KANAjetzt commented Nov 28, 2024

This adds 3 test scripts (test_script_A / B / C.gd) with their expected results (test_script_A / B/ C_processed.gd) to validate the functionality of _ModLoaderModHookPreProcessor.process_script().

Note

The class_name in the _processed.gd scripts must be commented out to avoid the "hiding global class" error.
Test run is broken until #495 is merged or func please_stop is removed from test script C.

TODO


Dev Notes

  • add this to the test script
format_date(day: int, \
month: int, year: int, special_thing := "\n\t\"\
")
  • I think this covers it quiet well already:
func why_would_you(put: int, \
	backslashes := "\\", in_here := "?!\n"
	):
	pass

@KANAjetzt KANAjetzt added this to the 4.x - 7.0.0 milestone Nov 28, 2024
@KANAjetzt KANAjetzt self-assigned this Nov 28, 2024
@KANAjetzt KANAjetzt force-pushed the test_process_script branch 3 times, most recently from bb2cb2c to 9289597 Compare December 25, 2024 10:04
@KANAjetzt KANAjetzt marked this pull request as ready for review December 25, 2024 11:29
@KANAjetzt KANAjetzt requested a review from Qubus0 December 25, 2024 11:36
@KANAjetzt KANAjetzt force-pushed the test_process_script branch from c556201 to f73e930 Compare January 12, 2025 20:23
@KANAjetzt KANAjetzt force-pushed the test_process_script branch from 92c5f02 to 925acc0 Compare January 24, 2025 10:32
@KANAjetzt KANAjetzt force-pushed the test_process_script branch from 4f1bd88 to bbd0dbe Compare January 26, 2025 17:04
Copy link
Collaborator

@Qubus0 Qubus0 left a comment

Choose a reason for hiding this comment

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

nice. this must be the funniest code in the whole repo.

i think the long term goal is to test all the cases separately, each with their own script. that way we'll know exactly what failed at a glance. but finding which one causes issues is mostly possible already and we also get tests for things like duplicate names and just multiple variables and functions in the same file in general.

one small addition would be subclasses to the uncovered cases

@KANAjetzt KANAjetzt added this pull request to the merge queue Jan 26, 2025
Merged via the queue into GodotModding:4.x with commit 8170899 Jan 26, 2025
1 check passed
@KANAjetzt KANAjetzt deleted the test_process_script branch January 28, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants