From 6733c6ce1f236230ae2c6c08cdb40af31f9ade16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Breitbart?= Date: Sun, 16 Jul 2017 14:05:55 +0200 Subject: [PATCH] test speedup defensive --- src/InputHandler.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/InputHandler.test.ts b/src/InputHandler.test.ts index d97404d6..bdf9cc97 100644 --- a/src/InputHandler.test.ts +++ b/src/InputHandler.test.ts @@ -163,7 +163,7 @@ describe('wcwidth', () => { assert.equal(wcwidth(0x30000), old_wcwidth(0x30000)); assert.equal(wcwidth(0x3fffe), old_wcwidth(0x3fffe)); }); - it('new is at least 10 times faster', () => { + it('new is at least 5 times faster', () => { let start_new = new Date().getTime(); let x = 0; for (let runs = 0; runs < 1; ++runs) @@ -176,6 +176,8 @@ describe('wcwidth', () => { for (let i = 0; i < 65536; ++i) y = old_wcwidth(i); let end_old = new Date().getTime(); - assert.equal(((end_new - start_new) * 10 < (end_old - start_old)), true); + //console.log((end_new - start_new)); + //console.log((end_old - start_old)); + assert.equal(((end_new - start_new) * 5 < (end_old - start_old)), true); }); });