add test for the base case
This commit is contained in:
parent
eedcd69941
commit
3a7db1603e
1 changed files with 32 additions and 0 deletions
|
|
@ -34,6 +34,7 @@
|
||||||
//#include <iostream>
|
//#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -49,6 +50,7 @@ namespace test{
|
||||||
// using std::vector;
|
// using std::vector;
|
||||||
// using std::cout;
|
// using std::cout;
|
||||||
// using std::endl;
|
// using std::endl;
|
||||||
|
using std::string;
|
||||||
using lib::LinkedElements;
|
using lib::LinkedElements;
|
||||||
using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST;
|
using lumiera::error::LUMIERA_ERROR_ITER_EXHAUST;
|
||||||
|
|
||||||
|
|
@ -191,6 +193,7 @@ namespace test{
|
||||||
{
|
{
|
||||||
verifyStateAdapter();
|
verifyStateAdapter();
|
||||||
|
|
||||||
|
verifyMonadOperator ();
|
||||||
UNIMPLEMENTED ("IterExplorer Monad");
|
UNIMPLEMENTED ("IterExplorer Monad");
|
||||||
verifyChainedIterators();
|
verifyChainedIterators();
|
||||||
verifyRawChainedIterators();
|
verifyRawChainedIterators();
|
||||||
|
|
@ -428,6 +431,35 @@ namespace test{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** @test cover the basic monad bind operator,
|
||||||
|
* which is used to build all the specialised Iterator flavours.
|
||||||
|
* The default implementation ("Combinator strategy") uses heap allocations
|
||||||
|
* to keep track of the intermediary results. (Of course this can be changed)
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
verifyMonadOperator ()
|
||||||
|
{
|
||||||
|
typedef IterExplorer<iter_explorer::WrappedSequence<NumberSequence> > SrcSequence;
|
||||||
|
|
||||||
|
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #892
|
||||||
|
SrcSequence src = exploreIter(seq(5));
|
||||||
|
|
||||||
|
string result = materialise(src >>= explode);
|
||||||
|
CHECK (result == "0-0-1-0-1-2-0-1-2-3");
|
||||||
|
|
||||||
|
result = materialise(src >>= explode >>= explode);
|
||||||
|
CHECK (result == "0-0-0-1-0-0-1-0-1-2");
|
||||||
|
#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #892
|
||||||
|
}
|
||||||
|
|
||||||
|
static NumberSequence
|
||||||
|
explode (uint top)
|
||||||
|
{
|
||||||
|
return seq(0,top);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
LAUNCHER (IterExplorer_test, "unit common");
|
LAUNCHER (IterExplorer_test, "unit common");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue