Moved check() function from individual tests to common.sh.