diff options
Diffstat (limited to 'testing')
-rw-r--r-- | testing/diff.ts | 11 | ||||
-rw-r--r-- | testing/format.ts | 4 | ||||
-rw-r--r-- | testing/format_test.ts | 7 |
3 files changed, 16 insertions, 6 deletions
diff --git a/testing/diff.ts b/testing/diff.ts index 4c96b3b28..dd544ac24 100644 --- a/testing/diff.ts +++ b/testing/diff.ts @@ -72,9 +72,14 @@ export default function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> { const delta = M - N; const size = M + N + 1; const fp = new Array(size).fill({ y: -1 }); - // INFO: This buffer is used to save memory and improve performance. - // The first half is used to save route and last half is used to save diff type. - // This is because, when I kept new uint8array area to save type, performance worsened. + /** + * INFO: + * This buffer is used to save memory and improve performance. + * The first half is used to save route and last half is used to save diff + * type. + * This is because, when I kept new uint8array area to save type,performance + * worsened. + */ const routes = new Uint32Array((M * N + size + 1) * 2); const diffTypesPtrOffset = routes.length / 2; let ptr = 0; diff --git a/testing/format.ts b/testing/format.ts index af8391b23..7a0d8c173 100644 --- a/testing/format.ts +++ b/testing/format.ts @@ -72,7 +72,9 @@ const getConstructorName = (val: new (...args: any[]) => any): string => (typeof val.constructor === "function" && val.constructor.name) || "Object"; /* global window */ -/** Is val is equal to global window object? Works even if it does not exist :) */ +/** Is val is equal to global window object? + * Works even if it does not exist :) + * */ // eslint-disable-next-line @typescript-eslint/no-explicit-any const isWindow = (val: any): val is Window => typeof window !== "undefined" && val === window; diff --git a/testing/format_test.ts b/testing/format_test.ts index 0601a5db2..39884d484 100644 --- a/testing/format_test.ts +++ b/testing/format_test.ts @@ -10,6 +10,7 @@ import { test } from "./mod.ts"; import { assertEquals } from "../testing/asserts.ts"; import { format } from "./format.ts"; +// eslint-disable-next-line max-len // eslint-disable-next-line @typescript-eslint/no-unused-vars,@typescript-eslint/no-explicit-any function returnArguments(...args: any[]): IArguments { return arguments; @@ -385,7 +386,8 @@ test({ val.prop = "value1"; assertEquals( format(val), - 'Object {\n "prop": "value1",\n Symbol(symbol1): "value2",\n Symbol(symbol2): "value3",\n}' + 'Object {\n "prop": "value1",\n Symbol(symbol1): "value2",\n ' + + 'Symbol(symbol2): "value3",\n}' ); } }); @@ -607,7 +609,8 @@ test({ const val = { prop: { prop: { prop: "value" } } }; assertEquals( format(val), - 'Object {\n "prop": Object {\n "prop": Object {\n "prop": "value",\n },\n },\n}' + 'Object {\n "prop": Object {\n "prop": Object {\n "prop": ' + + '"value",\n },\n },\n}' ); } }); |