Implements test_script() function