diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2021-09-26 13:29:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-26 13:29:55 -0400 |
commit | d739ccd63f0554f0f880e7463355dd5c4ff166e4 (patch) | |
tree | 41f06a949495e98adfac825419b82f4ab34a56d3 /test/test-japanese-util.js | |
parent | 25fe3ba5149cda36e173ee7427324fa74e6784be (diff) |
Fix japanese codepoint range issues (#1960)
* Add CJK_COMPATIBILITY_IDEOGRAPHS_RANGE
* Rename CJK_UNIFIED_IDEOGRAPHS_RANGES => CJK_IDEOGRAPH_RANGES
* Simplify isKana check
* Update tests
Diffstat (limited to 'test/test-japanese-util.js')
-rw-r--r-- | test/test-japanese-util.js | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/test/test-japanese-util.js b/test/test-japanese-util.js index 48dc9af7..f3b53844 100644 --- a/test/test-japanese-util.js +++ b/test/test-japanese-util.js @@ -33,7 +33,8 @@ function testIsCodePointKanji() { const data = [ ['力方', true], ['\u53f1\u{20b9f}', true], - ['かたカタ々kata、。?,.?', false] + ['かたカタ々kata、。?,.?', false], + ['逸逸', true] ]; for (const [characters, expected] of data) { @@ -65,7 +66,8 @@ function testIsCodePointJapanese() { const data = [ ['かたカタ力方々、。?', true], ['\u53f1\u{20b9f}', true], - ['kata,.?', false] + ['kata,.?', false], + ['逸逸', true] ]; for (const [characters, expected] of data) { @@ -109,7 +111,8 @@ function testIsStringPartiallyJapanese() { ['kata,.?', false], ['かたカタ力方々、。?invalid', true], ['\u53f1\u{20b9f}invalid', true], - ['kata,.?かた', true] + ['kata,.?かた', true], + ['逸逸', true] ]; for (const [string, expected] of data) { @@ -672,6 +675,21 @@ function testDistributeFurigana() { [ {text: 'シック', reading: 'シック・ビルしょうこうぐん'} ] + ], + // Kanji distribution tests + [ + ['逸らす', 'そらす'], + [ + {text: '逸', reading: 'そ'}, + {text: 'らす', reading: ''} + ] + ], + [ + ['逸らす', 'そらす'], + [ + {text: '逸', reading: 'そ'}, + {text: 'らす', reading: ''} + ] ] ]; |