mt-mods / technic

Technic mod for Minetest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve tests

S-S-X opened this issue · comments

commented

Few things to change:

Move solar arrays higher

Some networks use solar arrays and are placed to y=1, move these bit higher near y=50 or so and reduce total count of solar arrays.
This should reduce "background noise" for tests and is not really useful for testing.
If solar arrays need testing then new spec should be added for those, for other tests those are just components to allow testing...

Just moving solar arrays higher can reduce required node count significantly, this might not sound like big thing but it is.

Better readability for world layout

Use world.layout where possible (instead of world.place_node) to reduce world setup loops and give cable positions as area for example {{x=0,y=50,z=0},{x=0,y=50,z=100}}.
Remember that world.layout does clear existing world, consider world.add_layout if needed.

Assertions and argument order

In assertions move expected value to left side and actual value to right side where possible (to get more understandable failure messages).
Fun fact: these been mixed up even in luassert sources so there might actually be assertions that wont follow this... but I think most do