PuzzleScriptPlus icon indicating copy to clipboard operation
PuzzleScriptPlus copied to clipboard

Clean up test cases

Open Auroriax opened this issue 2 years ago • 8 comments

Some tests fail on capitalization changes & "The Far Away Danish Pastry..." test also fails for some unknown reason (probably it doesn't handle the comment just before a level incorrectly). Need to clean it up so all tests pass.

Also adding some PS+ tests might be nice to test output for prelude flags & case_sensitive...

Auroriax avatar May 09 '22 20:05 Auroriax

Add all of my own games?

Auroriax avatar May 16 '22 20:05 Auroriax

Now only the Danish Pastry test fails, it seems like it is unable to load level 7 because of a comment directly in-between level 6 and 7. Need to double check at which commit this behaviour broke, then consider a fix. Can't reproduce on the Dario Zubovic fork, or on live branch or c9de4f5 - Moves smoothcamera code from graphics to engine so tests will run here.

Auroriax avatar Feb 19 '23 16:02 Auroriax

Danish Pastry level 7 no longer works after this commit: 503c83e - Added GOTO commands.

Auroriax avatar Feb 19 '23 20:02 Auroriax

All tests now pass. I've added a PuzzleScript Plus-specific test suite with 23 tests (from my own games, the examples, and one game with an open source license). Should make an open call for adding more tests. There are still some weird issues with the Ctrl+J test generation on this fork, and I'm not yet sure why.

Auroriax avatar Feb 19 '23 22:02 Auroriax

I don't see a fix for Danish Pastry in any recent checkin. Is it fixed? And the others?

david-pfx avatar Feb 28 '23 08:02 david-pfx

Danish Pastry was bugfixed with https://github.com/Auroriax/PuzzleScriptPlus/commit/08c345df503901ece0b2a5d7a9a7469f002b9a09 . For the other tests I've changed their capitalization in the test data in https://github.com/Auroriax/PuzzleScriptPlus/commit/a9be0506d90ffa8ad087814a4081084f685c4e35. Now all tests should run.

Still actionable for this issue:

  1. Ask PS+ developers to allow adding their code to the unit tests
  2. Write unit tests for all new PS+ error messages and functionality. (Not sure to which degree this is possible, but simply checking for compilation errors/warnings should be possible for most features).

I'm not sure then I can get to the second point but I'll try to do so soon-ish.

Auroriax avatar Mar 01 '23 18:03 Auroriax

I found and fixed Danish Pastry in my merge version. Capitalisation is a work in progress, and will probably turn up more bugs when we get more and better PS+ tests. Any PS+ tests you can find are very much worth it. My plan is to do your (2): fill in the gaps so there is a test for everything, even if it's just compile and burn. But it'll take me time to get there.

david-pfx avatar Mar 01 '23 22:03 david-pfx

The merge PR I submitted resolves this issue. It can be closed.

david-pfx avatar Mar 08 '23 12:03 david-pfx