Skip to content

Commit

Permalink
Merge e0a1542 into e782748
Browse files Browse the repository at this point in the history
  • Loading branch information
fanerge committed Jul 16, 2018
2 parents e782748 + e0a1542 commit 80203a9
Show file tree
Hide file tree
Showing 3 changed files with 14,080 additions and 1 deletion.
32 changes: 32 additions & 0 deletions __tests__/string.spec.js
Expand Up @@ -107,4 +107,36 @@ describe('string', () => {
done();
});
});

it('works for unicode U+0000 to U+FFFF ', (done) => {
new Schema({
v: {
type: 'string',
len: 6,
message: 'haha',
},
}).validate({
v: '吉吉吉吉',
}, (errors) => {
expect(errors.length).toBe(1);
expect(errors[0].message).toBe('haha');
done();
});
});

it('works for unicode gt U+FFFF ', (done) => {
new Schema({
v: {
type: 'string',
len: 8, // 原来length属性应该为8,更正之后应该为4
message: 'haha',
},
}).validate({
v: '𠮷𠮷𠮷𠮷',
}, (errors) => {
expect(errors.length).toBe(1);
expect(errors[0].message).toBe('haha');
done();
});
});
});

0 comments on commit 80203a9

Please sign in to comment.