From 9e421daf679dfb39251a9325f8ad97ea479afbe6 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Fri, 16 Feb 2018 15:44:09 -0500 Subject: [PATCH] progtest: bug: constants are not initialized until rating Ugh, this is nasty. --- progtest/bin/runner.js | 3 --- progtest/src/env.js | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/progtest/bin/runner.js b/progtest/bin/runner.js index 11248672..88959922 100644 --- a/progtest/bin/runner.js +++ b/progtest/bin/runner.js @@ -32,8 +32,5 @@ const runner = require( '../src/env' ).console( program, process.stdout ); -// XXX: work around issue with consts not being initialized ahead of time -program.rater( {} ); - runner( case_yaml ) .catch( e => console.error( e ) ); diff --git a/progtest/src/env.js b/progtest/src/env.js index 8eeb8375..7e858541 100644 --- a/progtest/src/env.js +++ b/progtest/src/env.js @@ -52,6 +52,10 @@ module.exports = { .use( ConstResolver( program ) ) ( yaml_reader, TestCase ); + // XXX: work around issue with consts not being initialized ahead of + // time (initialized during actual rating...!) + program.rater( {} ); + return yaml => new Promise( ( resolve, reject ) => { try