committed by
陈帅
5 changed files with 16 additions and 16 deletions
@ -1,13 +1,13 @@ |
|||
import { getStrShowLength, cutStrByShowLength } from './index.js'; |
|||
import { getStrFullLength, cutStrByFullLength } from './index.js'; |
|||
|
|||
describe('test calculateShowLength', () => { |
|||
it('get show length', () => { |
|||
expect(getStrShowLength('一二,a,')).toEqual(8); |
|||
it('get full length', () => { |
|||
expect(getStrFullLength('一二,a,')).toEqual(8); |
|||
}); |
|||
it('cut str by show length', () => { |
|||
expect(cutStrByShowLength('一二,a,', 7)).toEqual('一二,a'); |
|||
it('cut str by full length', () => { |
|||
expect(cutStrByFullLength('一二,a,', 7)).toEqual('一二,a'); |
|||
}); |
|||
it('cut str when length small', () => { |
|||
expect(cutStrByShowLength('一22三', 5)).toEqual('一22'); |
|||
expect(cutStrByFullLength('一22三', 5)).toEqual('一22'); |
|||
}); |
|||
}); |
|||
|
|||
Loading…
Reference in new issue