Please check out the kind of things that have been done.
Test should always have the.
Try to avoid repeated code. Whenever that happens, use loops and subs
I am not sure the blocks around groups of tests make sense. They create a lexical scope, but in this case you're actually reusing code from the scope above, so not clear your intention. Also, better to create subtests as I've done here.
Please check out the kind of things that have been done.