Afforess / Factorio-Stdlib

Factorio Standard Library Project
ISC License
162 stars 45 forks source link

Add test cases for stdlib.event.opened #100

Closed ghost closed 7 years ago

ghost commented 7 years ago

@Nexela @Afforess

Thanks, Nexela for the work on the World simulator and pointing me in the right direction with opened spec test cases.

Created the test cases for important and prominent areas in the module.

Three test scenarios were core to stdlib.event.opened:

  1. Test that global._opened_guis initializes on Event.core_events.init_and_config.
  2. Test that raise_opened_closed_events & create_globals successfully register to their respective events.
  3. Test that all four script.raise_event calls get called under their respective conditions AND that we receive the correct event data table in the registered handlers when the events are raised.

Please feel free to leave any comments for any issues with the code or if you find anything that I missed or if you think certain parts need any refactoring.