mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-31 05:24:13 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			871 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			871 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { describe, test, assert, afterEach } from 'vitest';
 | |
| import { nyaize } from '@/scripts/nyaize.js';
 | |
| 
 | |
| function runTests(cases) {
 | |
|     for (const c of cases) {
 | |
|         const [input,expected] = c;
 | |
|         const got = nyaize(input);
 | |
|         assert.strictEqual(got, 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'],
 | |
|         ]);
 | |
|     });
 | |
| });
 |