import { assertEquals } from "../base.ts"; import Japanese from "../../api/japanese.ts"; interface Test { input: [string, string]; output: string; }; const cases = [ { input: ["繰り返す", "くりかえす"], output: "[繰](く)り[返](かえ)す" }, { input: ["漢字テスト", "かんじてすと"], output: "[漢字](かんじ)テスト" }, { input: ["凛々しく", "りりしく"], output: "[凛々](りり)しく" }, { input: ["字のテスト", "じのテスト"], output: "[字](じ)のテスト" }, { input: ["文字", "っ"], output: "[文字](っ)" }, { input: ["文字りす", "りりりす"], output: "[文字](りり)りす" }, { input: ["気を引き締める", "きをひきしめる"], output: "[気](き)を[引](ひ)き[締](し)める" }, // https://japanese.stackexchange.com/questions/69521/reading-per-kanji-irregular-readings { input: ["大口魚", "たら"], output: "[大口魚](たら)" }, ] satisfies Test[]; cases.forEach(({ input, output }) => { Deno.test(`Japanese API class - ${input}`, async () => { var jp = new Japanese(...input); assertEquals(jp.furigana("refold-tools"), output); }); });