2024-06-15 10:36:55 +00:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: dakkar and other Sharkey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2024-10-11 09:25:07 +00:00
|
|
|
import { nyaize } from '../src/nyaize.js';
|
2024-02-20 20:00:22 +00:00
|
|
|
|
|
|
|
function runTests(cases) {
|
2024-10-11 09:25:07 +00:00
|
|
|
for (const c of cases) {
|
|
|
|
const [input,expected] = c;
|
|
|
|
const got = nyaize(input);
|
|
|
|
expect(got).toEqual(expected);
|
|
|
|
}
|
2024-02-20 20:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
describe('nyaize', () => {
|
|
|
|
test('ja-JP', () => {
|
|
|
|
runTests([
|
|
|
|
['きれいな','きれいにゃ'],
|
|
|
|
['ナナナ', 'ニャニャニャ'],
|
|
|
|
['ナナ','ニャニャ'],
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
test('en-US', () => {
|
|
|
|
runTests([
|
|
|
|
['bar','bar'],
|
|
|
|
['banana','banyanya'],
|
|
|
|
['booting','booting'],
|
|
|
|
['morning','mornyan'],
|
|
|
|
['mmmorning','mmmornyan'],
|
|
|
|
['someone','someone'],
|
|
|
|
['everyone','everynyan'],
|
|
|
|
['foreveryone','foreverynyan'],
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|