Added tests for run_code() function