Files
homeclaw/tests/voice-place-check.test.ts

10 lines
834 B
TypeScript

import { test } from 'node:test';
import assert from 'node:assert/strict';
import { suspectSoundAlikePlace } from '../src/gateway/chat/voice-place-check';
test('세월 → 서울 의심', () => assert.equal(suspectSoundAlikePlace('세월'), '서울'));
test('주요 도시 정확 일치는 통과', () => { for (const c of ['서울', '부산', '구미', '대구']) assert.equal(suspectSoundAlikePlace(c), null); });
test('지점표에 있는 지명은 통과', () => { for (const c of ['현풍', '화원', '다사']) assert.equal(suspectSoundAlikePlace(c), null); });
test('소리가 많이 다르면 통과', () => assert.equal(suspectSoundAlikePlace('안양'), null));
test('영문·다단어는 통과', () => { assert.equal(suspectSoundAlikePlace('Seoul'), null); assert.equal(suspectSoundAlikePlace('서울 강남'), null); });