add some redistools tests. fix for loops in lua since they include the right side of the interval