sunjay / caves

2D Cave Exploration Game with Procedurally Generated Levels
Mozilla Public License 2.0
37 stars 6 forks source link

Test Map Generation #31

Open sunjay opened 6 years ago

sunjay commented 6 years ago

Should have an integration test or something that runs the level generation 1000 times with random map keys to make sure it doesn't panic during that time. Output the map key that failed (or just every map key if that is easier) so it is possible to debug.

Need to know that level generation doesn't fail too often. (May need to increase attempts every once in a while.)

Once we get more validations (e.g. #14, #20) this will also help us know that we aren't breaking any of those invariants.

Also want to somehow test that map generation is deterministic. That is, the same map key produces the same map every time you use it.

sunjay commented 6 years ago

Map generation still fails way too often. This test was disabled here: https://github.com/sunjay/caves/commit/0d70016b5cc2bf2d9cd1c9c59ef10a7ac7ab4a27

sunjay commented 5 years ago

Tests were removed during the refactoring because this is hard to do when using specs::World for everything. Need to think about a way to do this.