Auroriax / PuzzleScriptPlus

Puzzlescript Plus: Open Source HTML5 Puzzle Game Engine (with lots of extra functionality)
https://auroriax.github.io/PuzzleScript/
34 stars 4 forks source link

Crash during testing when state.invalid is set #87

Open david-pfx opened 1 year ago

david-pfx commented 1 year ago

In a test such as "each pattern to match on the left must have a corresponding pattern on the right of equal length"

david-pfx commented 1 year ago

BTW the code testing for PS+ errors does not belong here. But that's another story.

Auroriax commented 1 year ago

I'm sorry but I'm not following. What are you attempting to do that causes these issues? Could you include a repro case perhaps?

david-pfx commented 1 year ago

The above is the repro case. The code is visibly wrong. The fix is trivial. I've included it in my merge.

Auroriax commented 1 year ago

I'm sorry but I still don't understand what the issue is.

david-pfx commented 1 year ago

This is the title of one of the tests in the PS suite. Hence the quote marks. It has no meaning (to me) otherwise.

You can see it by simply running the PS tests, or the PR I submitted (which includes it).

Auroriax commented 1 year ago

All PS & PS+ tests for the develop branch are passing at the moment. Are you talking about tests that are failing while you're working on #23 ? Or something else?

david-pfx commented 1 year ago

a) Just read the code. It's obviously wrong, even if the tests didn't show it. b) Are you running the tests in the debugger and watching the console? In both PS and PS+ many tests fail with a type error, but the test report as passed. This is a separate issue.

Auroriax commented 1 year ago

Right, I can reproduce, and I can also reproduce this in the latest version of vanilla PS too (a6db028 - fixes #951), though I'm not sure if it's failing on the same tests. Still, this likely means it's a vanilla PS bug, please consider also reporting it there.

I'm trying to find line 3250 in compile.js, but the file only goes to line 31XX or so. Can you double check if the line number is correct? At this point you can also submit a PR, that might be clearer for me.

david-pfx commented 1 year ago

I have already submitted to PS: https://github.com/increpare/PuzzleScript/issues/961. The fix and that line no are already in my response to #23.