-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ParallelFuture based on concurrify
Adds the following functions: * Future.Par :: Future a b -> ConcurrentFuture a b * Future.seq :: ConcurrentFuture a b -> Future a b * Future.never :: () -> Future a a Closes #44
- Loading branch information
Showing
6 changed files
with
319 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use strict'; | ||
|
||
const expect = require('chai').expect; | ||
const Future = require('../fluture.js'); | ||
const U = require('./util'); | ||
const type = require('sanctuary-type-identifiers'); | ||
|
||
describe('FutureNever', () => { | ||
|
||
it('extends Future', () => { | ||
expect(Future.never()).to.be.an.instanceof(Future); | ||
}); | ||
|
||
it('is considered a member of fluture/Fluture', () => { | ||
expect(type(Future.never())).to.equal('fluture/Future'); | ||
}); | ||
|
||
describe('#fork()', () => { | ||
|
||
it('does nothing and returns a noop cancel function', () => { | ||
const m = Future.never(); | ||
const cancel = m.fork(U.noop, U.noop); | ||
cancel(); | ||
}); | ||
|
||
}); | ||
|
||
describe('#toString()', () => { | ||
|
||
it('returns the code to create the FutureNever', () => { | ||
const m = Future.never(); | ||
expect(m.toString()).to.equal('Future.never()'); | ||
}); | ||
|
||
}); | ||
|
||
}); |
Oops, something went wrong.