import { isFirstCharDigit } from '../is-first-char-digit'; describe('isFirstCharDigit', () => { test('应返回 true 如果字符串的第一位是数字', () => { expect(isFirstCharDigit('1abc')).toBe(true); expect(isFirstCharDigit('9xyz')).toBe(true); }); test('应返回 false 如果字符串的第一位不是数字', () => { expect(isFirstCharDigit('abc1')).toBe(false); expect(isFirstCharDigit('xyz9')).toBe(false); }); test('应返回 false 如果输入为空字符串', () => { expect(isFirstCharDigit('')).toBe(false); }); test('应返回 false 如果输入不是字符串', () => { expect(isFirstCharDigit(null as any)).toBe(false); expect(isFirstCharDigit(undefined as any)).toBe(false); expect(isFirstCharDigit(123 as any)).toBe(false); }); });