From 92a9fe0e49b490e2a255d687f855f97fcab7ae3d Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 13 Apr 2020 14:08:27 +0100 Subject: [PATCH] LibJS: Fix test files indentation (4 spaces) --- Libraries/LibJS/Tests/Boolean.js | 52 ++++++------ Libraries/LibJS/Tests/Boolean.prototype.js | 8 +- .../LibJS/Tests/Boolean.prototype.toString.js | 32 ++++---- .../LibJS/Tests/Boolean.prototype.valueOf.js | 32 ++++---- Libraries/LibJS/Tests/arrow-functions.js | 82 +++++++++---------- Libraries/LibJS/Tests/switch-basic-2.js | 6 +- Libraries/LibJS/Tests/switch-basic-3.js | 2 +- Libraries/LibJS/Tests/switch-basic.js | 8 +- 8 files changed, 111 insertions(+), 111 deletions(-) diff --git a/Libraries/LibJS/Tests/Boolean.js b/Libraries/LibJS/Tests/Boolean.js index d6f7f89d25..1a9f8593f1 100644 --- a/Libraries/LibJS/Tests/Boolean.js +++ b/Libraries/LibJS/Tests/Boolean.js @@ -1,35 +1,35 @@ try { - assert(Boolean.length === 1); - assert(typeof new Boolean() === "object"); - assert(new Boolean().valueOf() === false); + assert(Boolean.length === 1); + assert(typeof new Boolean() === "object"); + assert(new Boolean().valueOf() === false); - var foo = new Boolean(true); - var bar = new Boolean(true); + var foo = new Boolean(true); + var bar = new Boolean(true); - assert(foo !== bar); - assert(foo.valueOf() === bar.valueOf()); + assert(foo !== bar); + assert(foo.valueOf() === bar.valueOf()); - assert(new Boolean(true).toString() === "true"); - assert(new Boolean(false).toString() === "false"); + assert(new Boolean(true).toString() === "true"); + assert(new Boolean(false).toString() === "false"); - assert(typeof Boolean() === "boolean"); - assert(typeof Boolean(true) === "boolean"); + assert(typeof Boolean() === "boolean"); + assert(typeof Boolean(true) === "boolean"); - assert(Boolean() === false); - assert(Boolean(false) === false); - assert(Boolean(null) === false); - assert(Boolean(undefined) === false); - assert(Boolean(NaN) === false); - assert(Boolean("") === false); - assert(Boolean(0.0) === false); - assert(Boolean(-0.0) === false); - assert(Boolean(true) === true); - assert(Boolean("0") === true); - assert(Boolean({}) === true); - assert(Boolean([]) === true); - assert(Boolean(1)) === true; + assert(Boolean() === false); + assert(Boolean(false) === false); + assert(Boolean(null) === false); + assert(Boolean(undefined) === false); + assert(Boolean(NaN) === false); + assert(Boolean("") === false); + assert(Boolean(0.0) === false); + assert(Boolean(-0.0) === false); + assert(Boolean(true) === true); + assert(Boolean("0") === true); + assert(Boolean({}) === true); + assert(Boolean([]) === true); + assert(Boolean(1)) === true; - console.log("PASS"); + console.log("PASS"); } catch (err) { - console.log("FAIL: " + err); + console.log("FAIL: " + err); } diff --git a/Libraries/LibJS/Tests/Boolean.prototype.js b/Libraries/LibJS/Tests/Boolean.prototype.js index 929a38172d..de444128c3 100644 --- a/Libraries/LibJS/Tests/Boolean.prototype.js +++ b/Libraries/LibJS/Tests/Boolean.prototype.js @@ -1,8 +1,8 @@ try { - assert(typeof Boolean.prototype === "object"); - assert(Boolean.prototype.valueOf() === false); + assert(typeof Boolean.prototype === "object"); + assert(Boolean.prototype.valueOf() === false); - console.log("PASS"); + console.log("PASS"); } catch (err) { - console.log("FAIL: " + err); + console.log("FAIL: " + err); } diff --git a/Libraries/LibJS/Tests/Boolean.prototype.toString.js b/Libraries/LibJS/Tests/Boolean.prototype.toString.js index 5ecc51bd67..dd4848b796 100644 --- a/Libraries/LibJS/Tests/Boolean.prototype.toString.js +++ b/Libraries/LibJS/Tests/Boolean.prototype.toString.js @@ -1,23 +1,23 @@ try { - var foo = true; - assert(foo.toString() === "true"); - assert(true.toString() === "true"); + var foo = true; + assert(foo.toString() === "true"); + assert(true.toString() === "true"); - assert(Boolean.prototype.toString.call(true) === "true"); - assert(Boolean.prototype.toString.call(false) === "false"); + assert(Boolean.prototype.toString.call(true) === "true"); + assert(Boolean.prototype.toString.call(false) === "false"); - let error = null; - try { - Boolean.prototype.toString.call("foo"); - } catch (err) { - error = err; - } + let error = null; + try { + Boolean.prototype.toString.call("foo"); + } catch (err) { + error = err; + } - assert(error instanceof Error); - assert(error.name === "TypeError"); - assert(error.message === "Not a Boolean"); + assert(error instanceof Error); + assert(error.name === "TypeError"); + assert(error.message === "Not a Boolean"); - console.log("PASS"); + console.log("PASS"); } catch (err) { - console.log("FAIL: " + err); + console.log("FAIL: " + err); } diff --git a/Libraries/LibJS/Tests/Boolean.prototype.valueOf.js b/Libraries/LibJS/Tests/Boolean.prototype.valueOf.js index acb4c5dde6..af7fffaeab 100644 --- a/Libraries/LibJS/Tests/Boolean.prototype.valueOf.js +++ b/Libraries/LibJS/Tests/Boolean.prototype.valueOf.js @@ -1,23 +1,23 @@ try { - var foo = true; - assert(foo.valueOf() === true); - assert(true.valueOf() === true); + var foo = true; + assert(foo.valueOf() === true); + assert(true.valueOf() === true); - assert(Boolean.prototype.valueOf.call(true) === true); - assert(Boolean.prototype.valueOf.call(false) === false); + assert(Boolean.prototype.valueOf.call(true) === true); + assert(Boolean.prototype.valueOf.call(false) === false); - let error = null; - try { - Boolean.prototype.valueOf.call("foo"); - } catch (err) { - error = err; - } + let error = null; + try { + Boolean.prototype.valueOf.call("foo"); + } catch (err) { + error = err; + } - assert(error instanceof Error); - assert(error.name === "TypeError"); - assert(error.message === "Not a Boolean"); + assert(error instanceof Error); + assert(error.name === "TypeError"); + assert(error.message === "Not a Boolean"); - console.log("PASS"); + console.log("PASS"); } catch (err) { - console.log("FAIL: " + err); + console.log("FAIL: " + err); } diff --git a/Libraries/LibJS/Tests/arrow-functions.js b/Libraries/LibJS/Tests/arrow-functions.js index 5d4f118a7c..d2db8fdaf5 100644 --- a/Libraries/LibJS/Tests/arrow-functions.js +++ b/Libraries/LibJS/Tests/arrow-functions.js @@ -1,56 +1,56 @@ try { - let getNumber = () => 42; - assert(getNumber() === 42); + let getNumber = () => 42; + assert(getNumber() === 42); - let add = (a, b) => a + b; - assert(add(2, 3) === 5); + let add = (a, b) => a + b; + assert(add(2, 3) === 5); - const addBlock = (a, b) => { - let res = a + b; - return res; - }; - assert(addBlock(5, 4) === 9); + const addBlock = (a, b) => { + let res = a + b; + return res; + }; + assert(addBlock(5, 4) === 9); - const makeObject = (a, b) => ({ a, b }); - const obj = makeObject(33, 44); - assert(typeof obj === "object"); - assert(obj.a === 33); - assert(obj.b === 44); + const makeObject = (a, b) => ({ a, b }); + const obj = makeObject(33, 44); + assert(typeof obj === "object"); + assert(obj.a === 33); + assert(obj.b === 44); - let returnUndefined = () => {}; - assert(typeof returnUndefined() === "undefined"); + let returnUndefined = () => { }; + assert(typeof returnUndefined() === "undefined"); - const makeArray = (a, b) => [a, b]; - const array = makeArray("3", { foo: 4 }); - assert(array[0] === "3"); - assert(array[1].foo === 4); + const makeArray = (a, b) => [a, b]; + const array = makeArray("3", { foo: 4 }); + assert(array[0] === "3"); + assert(array[1].foo === 4); - let square = x => x * x; - assert(square(3) === 9); + let square = x => x * x; + assert(square(3) === 9); - let squareBlock = x => { - return x * x; - }; - assert(squareBlock(4) === 16); + let squareBlock = x => { + return x * x; + }; + assert(squareBlock(4) === 16); - const message = (who => "Hello " + who)("friends!"); - assert(message === "Hello friends!"); + const message = (who => "Hello " + who)("friends!"); + assert(message === "Hello friends!"); - const sum = ((x, y, z) => x + y + z)(1, 2, 3); - assert(sum === 6); + const sum = ((x, y, z) => x + y + z)(1, 2, 3); + assert(sum === 6); - const product = ((x, y, z) => { - let res = x * y * z; - return res; - })(5, 4, 2); - assert(product === 40); + const product = ((x, y, z) => { + let res = x * y * z; + return res; + })(5, 4, 2); + assert(product === 40); - const half = (x => { - return x / 2; - })(10); - assert(half === 5); + const half = (x => { + return x / 2; + })(10); + assert(half === 5); - console.log("PASS"); + console.log("PASS"); } catch { - console.log("FAIL"); + console.log("FAIL"); } diff --git a/Libraries/LibJS/Tests/switch-basic-2.js b/Libraries/LibJS/Tests/switch-basic-2.js index 1dbf35471d..10934fdf71 100644 --- a/Libraries/LibJS/Tests/switch-basic-2.js +++ b/Libraries/LibJS/Tests/switch-basic-2.js @@ -2,9 +2,9 @@ var a = "foo"; switch (a + "bar") { case 1: - break; + break; case "foobar": case 2: - console.log("PASS"); - break; + console.log("PASS"); + break; } diff --git a/Libraries/LibJS/Tests/switch-basic-3.js b/Libraries/LibJS/Tests/switch-basic-3.js index e0d3de8e85..7fe22742a8 100644 --- a/Libraries/LibJS/Tests/switch-basic-3.js +++ b/Libraries/LibJS/Tests/switch-basic-3.js @@ -2,5 +2,5 @@ var a = "foo"; switch (100) { default: - console.log("PASS"); + console.log("PASS"); } diff --git a/Libraries/LibJS/Tests/switch-basic.js b/Libraries/LibJS/Tests/switch-basic.js index ea63230ab6..04bda00717 100644 --- a/Libraries/LibJS/Tests/switch-basic.js +++ b/Libraries/LibJS/Tests/switch-basic.js @@ -1,10 +1,10 @@ switch (1 + 2) { case 3: - console.log("PASS"); - break; + console.log("PASS"); + break; case 5: case 1: - break; + break; default: - break; + break; }