import BaseFunc from '../../src/base/func'; test('stringEmptyDefault', () => { expect(BaseFunc.stringEmptyDefault('a', 'b')).toBe('a'); }); test('stringSplit',()=>{ expect(BaseFunc.stringSplit('').length).toBe(0); }) test('stringArrayOption empty', () => { expect(BaseFunc.stringArrayOption('', 'b', 1)).toBe('b'); }); test('stringArrayOption auto add or del', () => { expect(BaseFunc.stringArrayOption('ab,bc,cd', 'b', 3)).toBe('ab,bc,cd,b'); }); test('stringArrayOption auto add or del 2', () => { expect(BaseFunc.stringArrayOption('ab,bc,cd', 'bc', 3)).toBe('ab,cd'); }); test('stringArrayOption auto add or del rep', () => { expect(BaseFunc.stringArrayOption('ab,bc,bc', 'bc', 3)).toBe('ab,bc'); }); test('replaceWithObject', () => { expect(BaseFunc.replaceWithObject('[abc][def]', {abc:'xxx'})).toBe('xxx'); });