use sane version of split

This commit is contained in:
Domen Kožar 2019-10-01 12:10:07 +02:00
commit c97af141f3
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246
3 changed files with 15 additions and 7 deletions

View file

@ -1,8 +1,13 @@
import {extrasperse} from '../src/utils'
import {extrasperse, saneSplit} from '../src/utils'
test('extrasperse', async() => {
expect(extrasperse('-A', ["foo", "bar"])).toEqual(["-A", "foo", "-A", "bar"]);
expect(extrasperse('-A', [])).toEqual([])
expect(extrasperse('-A', [])).toEqual([]);
});
test('saneSplit', async() => {
expect(saneSplit("", /\s+/)).toEqual([]);
expect(saneSplit("foo bar", /\s+/)).toEqual(["foo", "bar"]);
})
// TODO: hopefully github actions will support integration tests