diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2024-01-28 07:22:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-28 12:22:47 +0000 |
commit | acc013a1a8051d34322f0f5f91d7bdecc0a18843 (patch) | |
tree | 601344b2f047f395548ddfb16a83319af10464f9 /test/japanese-util.test.js | |
parent | a51f1ab2dc675a49bfeeb08cc24b97eb8d888e4a (diff) |
JapaneseUtil refactor (#555)
* Copy functions from JapaneseUtil
* Remove JapaneseUtil
* Update usages of JapaneseUtil functions
Diffstat (limited to 'test/japanese-util.test.js')
-rw-r--r-- | test/japanese-util.test.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/test/japanese-util.test.js b/test/japanese-util.test.js index ab14f209..d7b05c3e 100644 --- a/test/japanese-util.test.js +++ b/test/japanese-util.test.js @@ -18,10 +18,8 @@ import {describe, expect, test} from 'vitest'; import {TextSourceMap} from '../ext/js/general/text-source-map.js'; -import {JapaneseUtil} from '../ext/js/language/sandbox/japanese-util.js'; -import * as wanakana from '../ext/lib/wanakana.js'; - -const jp = new JapaneseUtil(wanakana); +import * as jpw from '../ext/js/language/japanese-wanakana.js'; +import * as jp from '../ext/js/language/japanese.js'; /** */ function testIsCodePointKanji() { @@ -199,7 +197,7 @@ function testConvertToRomaji() { ]; test.each(data)('%s -> %o', (string, expected) => { - expect(jp.convertToRomaji(string)).toStrictEqual(expected); + expect(jpw.convertToRomaji(string)).toStrictEqual(expected); }); }); } @@ -268,8 +266,8 @@ function testConvertAlphabeticToKana() { for (const [string, expected, expectedSourceMapping] of data) { test(`${string} -> ${string}${typeof expectedSourceMapping !== 'undefined' ? ', ' + JSON.stringify(expectedSourceMapping) : ''}`, () => { const sourceMap = new TextSourceMap(string); - const actual1 = jp.convertAlphabeticToKana(string, null); - const actual2 = jp.convertAlphabeticToKana(string, sourceMap); + const actual1 = jpw.convertAlphabeticToKana(string, null); + const actual2 = jpw.convertAlphabeticToKana(string, sourceMap); expect(actual1).toStrictEqual(expected); expect(actual2).toStrictEqual(expected); if (typeof expectedSourceMapping !== 'undefined') { |