34 lines
959 B
TypeScript
34 lines
959 B
TypeScript
// packages/core/__tests__/address-input.test.ts
|
|
import { describe, expect, it } from 'vitest'
|
|
import { isAddressInput } from '../src/input-intelligence'
|
|
|
|
describe('isAddressInput', () => {
|
|
it('주소·경로·쿼리를 치는 중이면 true', () => {
|
|
for (const prefix of [
|
|
'https://youtube.com/shorts/32P7',
|
|
'여기 봐 www.naver',
|
|
'haramlog.app/ja/beta',
|
|
'mail.google.com/mail/u/0/#inbox',
|
|
'D:/workspace/맛집추천',
|
|
'./src/main',
|
|
'd3x9Z0iqC2/?stkn=em1z',
|
|
'page?utm_source=meta'
|
|
]) {
|
|
expect(isAddressInput(prefix), prefix).toBe(true)
|
|
}
|
|
})
|
|
|
|
it('문장·숫자·띄어 쓴 뒤는 false', () => {
|
|
for (const prefix of [
|
|
'언제쯤일까?',
|
|
'1/2 정도만',
|
|
'네.좋아요',
|
|
'v1.10.1 배포',
|
|
'오늘 회의는 내일',
|
|
'https://youtube.com 이거 봐 ',
|
|
'ok'
|
|
]) {
|
|
expect(isAddressInput(prefix), prefix).toBe(false)
|
|
}
|
|
})
|
|
})
|