diff options
Diffstat (limited to 'test/base.ts')
-rw-r--r-- | test/base.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/base.ts b/test/base.ts index 79c39ce..8369bfe 100644 --- a/test/base.ts +++ b/test/base.ts @@ -2,9 +2,17 @@ export { assertEquals } from "https://deno.land/std@0.193.0/testing/asserts.ts"; import Yomikun from "../api/yomikun.ts"; import DirectCoreClient from '../core/direct/client.ts'; +import { Wrap } from "../util/wrap.ts"; export const core = new DirectCoreClient(); export const api = new Yomikun(core); await api.ready; +export function formatCaseIndex(i: number, total: number) { + let out = ""; + out += (i+1).toString().padStart(Math.log10(total) + 1, '0'); + out += "/"; + out += total.toString(); + return out.wrap(Wrap.parenthesis); +} |