Skip to content

Commit

Permalink
added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Connum committed Mar 18, 2019
1 parent 92dbf78 commit caa66bb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ describe('Default splitting tests', () => {
assert.deepEqual(pinyinSeparate('nĭhăoma'), expectedVal);
});

it('should split Wǒhěnhǎoxièxiènǐ\'ne', () => {
const expectedVal = ['Wǒ', 'hěn', 'hǎo', 'xiè', 'xiè', 'nǐ', 'ne'];
assert.deepEqual(pinyinSeparate("Wǒhěnhǎoxièxiènǐ'ne"), expectedVal);
});

it('should split Xián​\'ān', () => {
const expectedVal = ['Xián', 'ān'];
assert.deepEqual(pinyinSeparate('Xián\'ān'), expectedVal);
});

it('should split Xiànán', () => {
const expectedVal = ['Xià', 'nán'];
assert.deepEqual(pinyinSeparate('Xiànán'), expectedVal);
});

it('should split jiān rěn bù bá with non-breaking spaces', () => {
const expectedVal = ['jiān', 'rěn', 'bù', 'bá'];
const nbsp = String.fromCharCode(160);
Expand Down

0 comments on commit caa66bb

Please sign in to comment.