Stardew Valley: Fix a bug where locations in logic would disappear from universal tracker as items get sent (#4230)

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
This commit is contained in:
Jouramie
2024-11-29 19:46:35 -05:00
committed by GitHub
parent 492e3a355e
commit e262c8be9c
17 changed files with 243 additions and 203 deletions

View File

@@ -7,9 +7,6 @@ import unittest
from BaseClasses import get_seed
from .. import SVTestCase
# There seems to be 4 bytes that appear at random at the end of the output, breaking the json... I don't know where they came from.
BYTES_TO_REMOVE = 4
# <function Location.<lambda> at 0x102ca98a0>
lambda_regex = re.compile(r"^<function Location\.<lambda> at (.*)>$")
@@ -27,8 +24,8 @@ class TestGenerationIsStable(SVTestCase):
output_a = subprocess.check_output([sys.executable, '-m', 'worlds.stardew_valley.test.stability.StabilityOutputScript', '--seed', str(seed)])
output_b = subprocess.check_output([sys.executable, '-m', 'worlds.stardew_valley.test.stability.StabilityOutputScript', '--seed', str(seed)])
result_a = json.loads(output_a[:-BYTES_TO_REMOVE])
result_b = json.loads(output_b[:-BYTES_TO_REMOVE])
result_a = json.loads(output_a)
result_b = json.loads(output_b)
for i, ((room_a, bundles_a), (room_b, bundles_b)) in enumerate(zip(result_a["bundles"].items(), result_b["bundles"].items())):
self.assertEqual(room_a, room_b, f"Bundle rooms at index {i} is different between both executions. Seed={seed}")