Move functional interface
tests out of select
tests.
This commit is contained in:
parent
ecc01b686e
commit
03ebfaf7ab
1 changed files with 33 additions and 33 deletions
|
@ -118,43 +118,43 @@ describe(`Channel`, function () {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe(`functional interface`, async function () {
|
describe(`functional interface`, async function () {
|
||||||
describe(`map`, function () {
|
describe(`map`, function () {
|
||||||
it(`full application`, async function () {
|
it(`full application`, async function () {
|
||||||
assert.deepEqual(
|
assert.deepEqual(
|
||||||
await toArray(Channel.map(
|
await toArray(Channel.map(
|
||||||
(value) => value.toUpperCase(),
|
(value) => value.toUpperCase(),
|
||||||
Channel.of(`a`, `b`, `c`)
|
Channel.of(`a`, `b`, `c`)
|
||||||
)),
|
)),
|
||||||
[`A`, `B`, `C`]
|
[`A`, `B`, `C`]
|
||||||
)
|
)
|
||||||
})
|
|
||||||
|
|
||||||
it(`partial application`, async function () {
|
|
||||||
assert.deepEqual(
|
|
||||||
await toArray(Channel.map((value) =>
|
|
||||||
value.toUpperCase())(Channel.of(`a`, `b`, `c`))
|
|
||||||
),
|
|
||||||
[`A`, `B`, `C`]
|
|
||||||
)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe(`slice`, function () {
|
it(`partial application`, async function () {
|
||||||
it(`full application`, async function () {
|
assert.deepEqual(
|
||||||
assert.deepEqual(
|
await toArray(Channel.map((value) =>
|
||||||
await toArray(Channel.slice(1, 4, Channel.of(0, 1, 2, 3, 4))),
|
value.toUpperCase())(Channel.of(`a`, `b`, `c`))
|
||||||
[1, 2, 3]
|
),
|
||||||
)
|
[`A`, `B`, `C`]
|
||||||
})
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
it(`partial application`, async function () {
|
describe(`slice`, function () {
|
||||||
assert.deepEqual(
|
it(`full application`, async function () {
|
||||||
await toArray(Channel.slice(1, 4)(Channel.of(0, 1, 2, 3, 4))),
|
assert.deepEqual(
|
||||||
[1, 2, 3]
|
await toArray(Channel.slice(1, 4, Channel.of(0, 1, 2, 3, 4))),
|
||||||
)
|
[1, 2, 3]
|
||||||
})
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it(`partial application`, async function () {
|
||||||
|
assert.deepEqual(
|
||||||
|
await toArray(Channel.slice(1, 4)(Channel.of(0, 1, 2, 3, 4))),
|
||||||
|
[1, 2, 3]
|
||||||
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue