Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/tests/test_pv-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,36 @@ describe('USA App', () => {
const result = TEST_ONLY.getUserInputPrefix('wazai');
expect(result).toEqual('wazai');
});

it('should return an empty string if an empty string is given', () => {
const result = TEST_ONLY.getUserInputPrefix('');
expect(result).toEqual('');
});

it('should return the prefix including spaces and long vowel marks', () => {
const result = TEST_ONLY.getUserInputPrefix('あーる γ΄γƒΌγ˜γƒΌ');
expect(result).toEqual('あーる γ΄γƒΌγ˜γƒΌ');
});

it('should stop at the first disallowed character (number)', () => {
const result = TEST_ONLY.getUserInputPrefix('hello123world');
expect(result).toEqual('hello');
});

it('should stop at the first disallowed character (Katakana)', () => {
const result = TEST_ONLY.getUserInputPrefix('あいうエγ‚ͺ');
expect(result).toEqual('あいう');
});

it('should stop at the first disallowed character (symbol)', () => {
const result = TEST_ONLY.getUserInputPrefix('hello!world');
expect(result).toEqual('hello');
});

it('should handle mixed allowed characters', () => {
const result = TEST_ONLY.getUserInputPrefix('ABC あいう');
expect(result).toEqual('ABC あいう');
});
});

describe('ignoreUnnecessaryDiffs', () => {
Expand Down
Loading