mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-27 03:24:12 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			36 lines
		
	
	
	
		
			895 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
	
		
			895 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /*
 | |
|  * SPDX-FileCopyrightText: dakkar and other Sharkey contributors
 | |
|  * SPDX-License-Identifier: AGPL-3.0-only
 | |
|  */
 | |
| 
 | |
| import { nyaize } from '../src/nyaize.js';
 | |
| 
 | |
| function runTests(cases) {
 | |
| 	for (const c of cases) {
 | |
| 		const [input,expected] = c;
 | |
| 		const got = nyaize(input);
 | |
| 		expect(got).toEqual(expected);
 | |
| 	}
 | |
| }
 | |
| 
 | |
| 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'],
 | |
|         ]);
 | |
|     });
 | |
| });
 |