SimonN / LixD

Lix: Lemmings-like game with puzzles, editor, multiplayer
https://www.lixgame.com
132 stars 17 forks source link

Unittest in nextlev/tests.d fails, is commented out. Re-enable. #452

Closed SimonN closed 1 year ago

SimonN commented 1 year ago

Lix 0.10.5

In src/file/nextlev/tests.d, I've commented out the following assert in a unittest. The assert started to fail after I've upgraded from DMD v2.100 to DMD v2.102.1.

Expected: Fix the underlying problem instead and uncomment the assert.

/+
 + DTODOUNITTEST:
 + This test started to fail with/before DMD v2.102.1,
 + but after DMD v2.100. It would be better if the test still passed.
 +
 assert (levelsIterated == fx.root.weight,
     "iteration should find exactly the leaves that contribute to weight");
+/
SimonN commented 1 year ago

I've reduced this to how package optional 1.3.0 behaves between DMD 2.100 and DMD 2.102.1, and asked directly at package optional:

https://github.com/aliak00/optional/issues/58

I've worked around the behavior by avoiding .oc. chains in some of the assignments. The fixing commit is not yet in this repository, but only in my unstable repository's master branch. That commit (Fix #452: Next-level search, re-enable unittest) will likely be rebased before release, therefore I'm not linking directly to a commit sha.

SimonN commented 1 year ago

The unittest is live again and passes in 0.10.10.

Also, this fixed a bug where the next-level search would not iterate through more than 1 already-solved level. This bug arose from the same behavior as the filed issue here (the breakage of the unittest).