mirror of
https://codeberg.org/icewind/attic-action.git
synced 2026-06-03 17:44:07 +02:00
saneSplit -> nonEmptySplit
This commit is contained in:
parent
cea7883cb2
commit
34a3c66a7e
5 changed files with 21 additions and 21 deletions
|
|
@ -1,13 +1,13 @@
|
|||
import {extrasperse, saneSplit} from '../src/strings'
|
||||
import {prependEach, nonEmptySplit} from '../src/strings'
|
||||
|
||||
test('extrasperse', async() => {
|
||||
expect(extrasperse('-A', ["foo", "bar"])).toEqual(["-A", "foo", "-A", "bar"]);
|
||||
expect(extrasperse('-A', [])).toEqual([]);
|
||||
test('prependEach', async() => {
|
||||
expect(prependEach('-A', ["foo", "bar"])).toEqual(["-A", "foo", "-A", "bar"]);
|
||||
expect(prependEach('-A', [])).toEqual([]);
|
||||
});
|
||||
|
||||
test('saneSplit', async() => {
|
||||
expect(saneSplit("", /\s+/)).toEqual([]);
|
||||
expect(saneSplit("foo bar", /\s+/)).toEqual(["foo", "bar"]);
|
||||
test('nonEmptySplit', async() => {
|
||||
expect(nonEmptySplit("", /\s+/)).toEqual([]);
|
||||
expect(nonEmptySplit("foo bar", /\s+/)).toEqual(["foo", "bar"]);
|
||||
})
|
||||
|
||||
// TODO: hopefully github actions will support integration tests
|
||||
Loading…
Add table
Add a link
Reference in a new issue