Enhanced implementation of real_test.js.