diff --git a/tests/library/iter-tree-explorer-test.cpp b/tests/library/iter-tree-explorer-test.cpp index 67a0125fd..c8ae64a26 100644 --- a/tests/library/iter-tree-explorer-test.cpp +++ b/tests/library/iter-tree-explorer-test.cpp @@ -152,15 +152,20 @@ namespace test{ size_t cnt_; char letter_; - static char +// static + char rndLetter() { - return 'A' + rand() % 26; + static _Fmt fmt{"rLet(%0d < %0d) → %s"}; + char ll = 'A' + rand() % 26; + cout << fmt % cnt_ % lim_ % ll <::max()) - : lim_{len} + RandomSeq(int len =0) + : lim_{len>=0? len : std::numeric_limits::max()} , cnt_{0} , letter_{rndLetter()} { } @@ -915,8 +920,8 @@ namespace test{ { // Layer-1: the search space with "hidden" implementation using DataSrc = IterExploreSource; - DataSrc searchSpace = treeExplore(RandomSeq{}) - .expand([](char){ return RandomSeq{15}; }) + DataSrc searchSpace = treeExplore(RandomSeq{-1}) + .expand([](char){ return RandomSeq{4}; }) .asIterSource(); // Layer-2: State for search algorithm @@ -940,7 +945,7 @@ namespace test{ }; // Layer-3: Evaluation pipeline to drive search - string toFind = util::join (treeExplore (RandomSeq{5})); + string toFind = util::join (treeExplore (RandomSeq{5}), ""); cout << "Search in random tree: toFind = "<pos < it->toFind.size() - 1 + and *(it->src) == it->toFind[it->pos]) + { + cout <<"|!| expand "<protocol)<src)<<" -->> "<protocol)<src) == it->toFind[it->pos]) + return true; + else { + cout << "|↯| "<<*(it->src)<< " ... " <protocol)< - + @@ -5889,7 +5889,7 @@ - + @@ -6206,6 +6206,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7053,6 +7085,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +