Skip to content

Commit

Permalink
added more tests (see #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Connum committed Oct 28, 2023
1 parent 404908c commit 126fcac
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,19 @@ 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 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 Wǒhěnhǎonĭ\'ne', () => {
const expectedVal = ['Wǒ', 'hěn', 'hǎo', 'nĭ', 'ne'];
assert.deepEqual(pinyinSeparate('Wǒhěnhǎonĭ\'ne'), expectedVal);
});

it('should split Wohenhaoni\'ne', () => {
const expectedVal = ['Wo', 'hen', 'hao', 'ni', 'ne'];
assert.deepEqual(pinyinSeparate('Wohenhaoni\'ne'), expectedVal);
});

it('should split Xián​\'ān', () => {
Expand Down Expand Up @@ -109,9 +119,9 @@ describe('Default splitting tests', () => {
assert.deepEqual(pinyinSeparate('Duìbùqǐ wǒ de zhōngwén bù hǎo'), expectedVal);
});

it('should split zuìjìn zěnme yàng', () => {
const expectedVal = ['', 'zuì', 'jìn', 'zěn', 'me', 'yàng'];
assert.deepEqual(pinyinSeparate(' zuìjìn zěnme yàng'), expectedVal);
it('should split zuìjìn zěnme yàng', () => {
const expectedVal = ['', 'zuì', 'jìn', 'zěn', 'me', 'yàng'];
assert.deepEqual(pinyinSeparate(' zuìjìn zěnme yàng'), expectedVal);
});

it('should split yundongyuan', () => {
Expand Down

0 comments on commit 126fcac

Please sign in to comment.