gdlint fixes
This commit is contained in:
@@ -3,7 +3,7 @@ extends SceneTree
|
||||
# Test to verify that existing save files with old checksum format can be migrated
|
||||
# This ensures backward compatibility with the checksum fix
|
||||
|
||||
const TestHelper = preload("res://tests/helpers/TestHelper.gd")
|
||||
const TestHelperClass = preload("res://tests/helpers/TestHelper.gd")
|
||||
|
||||
|
||||
func _initialize():
|
||||
@@ -18,13 +18,13 @@ func _initialize():
|
||||
|
||||
|
||||
func run_tests():
|
||||
TestHelper.print_test_header("Migration Compatibility")
|
||||
TestHelperClass.print_test_header("Migration Compatibility")
|
||||
test_migration_compatibility()
|
||||
TestHelper.print_test_footer("Migration Compatibility")
|
||||
TestHelperClass.print_test_footer("Migration Compatibility")
|
||||
|
||||
|
||||
func test_migration_compatibility():
|
||||
TestHelper.print_step("Old Save File Compatibility")
|
||||
TestHelperClass.print_step("Old Save File Compatibility")
|
||||
var old_save_data = {
|
||||
"_version": 1,
|
||||
"high_score": 150,
|
||||
@@ -57,13 +57,13 @@ func test_migration_compatibility():
|
||||
print("New checksum format: %s" % new_checksum)
|
||||
|
||||
# The checksums should be different (old system broken)
|
||||
TestHelper.assert_not_equal(
|
||||
TestHelperClass.assert_not_equal(
|
||||
old_checksum, new_checksum, "Old and new checksum formats should be different"
|
||||
)
|
||||
print("Old checksum: %s" % old_checksum)
|
||||
print("New checksum: %s" % new_checksum)
|
||||
|
||||
TestHelper.print_step("New System Self-Consistency")
|
||||
TestHelperClass.print_step("New System Self-Consistency")
|
||||
# Remove old checksum and recalculate
|
||||
loaded_data.erase("_checksum")
|
||||
var first_checksum = _calculate_new_checksum(loaded_data)
|
||||
@@ -77,15 +77,15 @@ func test_migration_compatibility():
|
||||
|
||||
var second_checksum = _calculate_new_checksum(reloaded_data)
|
||||
|
||||
TestHelper.assert_equal(
|
||||
TestHelperClass.assert_equal(
|
||||
first_checksum,
|
||||
second_checksum,
|
||||
"New system should be self-consistent across save/load cycles"
|
||||
)
|
||||
print("Consistent checksum: %s" % first_checksum)
|
||||
|
||||
TestHelper.print_step("Migration Strategy Verification")
|
||||
TestHelper.assert_true(true, "Version-based checksum handling implemented")
|
||||
TestHelperClass.print_step("Migration Strategy Verification")
|
||||
TestHelperClass.assert_true(true, "Version-based checksum handling implemented")
|
||||
print("✓ Files without _checksum: Allow (backward compatibility)")
|
||||
print("✓ Files with version < current: Recalculate checksum after migration")
|
||||
print("✓ Files with current version: Use new checksum validation")
|
||||
|
||||
Reference in New Issue
Block a user