Skript icon indicating copy to clipboard operation
Skript copied to clipboard

Add some test expressions

Open Efnilite opened this issue 1 year ago • 4 comments

Description

Adds some test expressions which I felt were missing.

  • test world can now be used instead of world "world"
  • test location can now be used instead of spawn of world "world"
  • test block can now be used instead of block at spawn of world "world"
  • All changed tests have no changed logic, except the block iterator test. This was changed to not fail since some other test forgot to reset the block to air, so it would've been a chest, failing the test.

Also adds event-world event value.


Target Minecraft Versions: any Requirements: none Related Issues: none

Efnilite avatar Oct 10 '24 18:10 Efnilite

There’s event-location in tests https://github.com/SkriptLang/Skript/blob/ba32d7ad48edb8e33d5f5d2e44d03bba94ffb2de/src/main/java/ch/njol/skript/test/runner/EvtTestCase.java#L45-L59

NotSoDelayed avatar Oct 11 '24 04:10 NotSoDelayed

There’s event-location in tests

https://github.com/SkriptLang/Skript/blob/ba32d7ad48edb8e33d5f5d2e44d03bba94ffb2de/src/main/java/ch/njol/skript/test/runner/EvtTestCase.java#L45-L59

this is used in like 5 tests, also test-location looks nicer :)

Efnilite avatar Oct 11 '24 15:10 Efnilite

I don't like the removal of the event-%classinfo% also could be used by external addons using the testing suite.

I don't mind having test-%classinfo% but I prefer event-%classinfo% more. I have no say, so I don't want to review this.

TheLimeGlass avatar Oct 11 '24 18:10 TheLimeGlass

I agree, removing event-* without a grace period is a breaking change.

NotSoDelayed avatar Oct 12 '24 02:10 NotSoDelayed