Skip to content

Commit

Permalink
Fixed visualization test for total order MultiIndexSet.
Browse files Browse the repository at this point in the history
  • Loading branch information
mparno committed Jul 22, 2022
1 parent 2dbd5d1 commit c61350d
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions tests/MultiIndices/Test_MultiIndexSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,6 @@ TEST_CASE("Testing the MultiIndexSet class", "[MultiIndexSet]" ) {
REQUIRE( isAdmiss );
}

SECTION("Visualize")
{
auto limiter = [](MultiIndex const& multi){ return ( (multi.Get(0)==0)||(multi.Get(1)==0)||((multi.Get(0)<2)&&(multi.Get(1)<2)));};

MultiIndexSet set = MultiIndexSet::CreateTotalOrder(2, 3, limiter);
set.SetLimiter( MultiIndexLimiter::None() );

std::stringstream truth, output;
truth << " 4 | r \n 3 | a m \n 2 | a r \n 1 | a a r m \n 0 | a a a a r \n ----------------\n 0 1 2 3 4 \n";

set.Visualize(output);

REQUIRE(output.str() == truth.str());
}

/*
AdmissableNeighbor.UndefinedNeighbor
Expand Down Expand Up @@ -478,4 +464,25 @@ TEST_CASE("MultiIndexSet Visualization Test", "[MultiIndexSet_Viz]")

CHECK(expected.str() == sstream.str());
}

SECTION("TotalOrder")
{
auto limiter = [](MultiIndex const& multi){ return ( (multi.Get(0)==0)||(multi.Get(1)==0)||((multi.Get(0)<2)&&(multi.Get(1)<2)));};

MultiIndexSet set = MultiIndexSet::CreateTotalOrder(2, 3, limiter);
set.SetLimiter( MultiIndexLimiter::None() );

std::stringstream truth, output;
truth << " 4 | r \n"
<< " 3 | a m \n"
<< " 2 | a r \n"
<< " 1 | a a r m \n"
<< " 0 | a a a a r \n"
<< " ----------------\n"
<< " 0 1 2 3 4 \n";

set.Visualize(output);

REQUIRE(output.str() == truth.str());
}
}

0 comments on commit c61350d

Please sign in to comment.