From fe089b79fd6dc42cea011e04a0e3e65f182c024d Mon Sep 17 00:00:00 2001 From: Sergi Vladykin Date: Thu, 5 Oct 2017 00:13:25 +0300 Subject: [PATCH] File lock test improved --- test/test-file-lock.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/test-file-lock.js b/test/test-file-lock.js index 70d48a5..462677c 100644 --- a/test/test-file-lock.js +++ b/test/test-file-lock.js @@ -38,8 +38,11 @@ function withLock(fun) { try { lock = raf.getChannel().lock(); } - catch(e if e instanceof OverlappingFileLockException) { - Thread.sleep(1); + catch (e) { + if (e instanceof OverlappingFileLockException) + Thread.sleep(1); + else + throw e; } } while (lock === null) @@ -83,7 +86,7 @@ for (var i = 0; i < THREADS; i++) { throw "Error: " + max + ", " + mid + ", " + min; // Fibonacci sequence check - if (max !== min + mid) + if (max != min + mid) throw "Error: " + max + " != " + mid + " + " + min; // Too big value - restart the sequence.