aboutsummaryrefslogtreecommitdiff
path: root/test/sandbox.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/sandbox.js')
-rw-r--r--test/sandbox.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/sandbox.js b/test/sandbox.js
index c155f91c..974f5211 100644
--- a/test/sandbox.js
+++ b/test/sandbox.js
@@ -1,3 +1,4 @@
+var semver = require("semver");
var vm = require("vm");
function safe_log(arg, level) {
@@ -63,7 +64,7 @@ exports.run_code = function(code) {
process.stdout.write = original_write;
}
};
-exports.same_stdout = ~process.version.lastIndexOf("v0.12.", 0) ? function(expected, actual) {
+exports.same_stdout = semver.satisfies(process.version, "0.12") ? function(expected, actual) {
if (typeof expected != typeof actual) return false;
if (typeof expected != "string") {
if (expected.name != actual.name) return false;