From 2a922d679ec36743287191fbd9f67a6fef9f7f1b Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Sun, 24 Jul 2022 10:00:06 +1000 Subject: Bug [#2340] Simplify expand all folds. Speed up expand line a little. --- test/unit/testContractionState.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test') diff --git a/test/unit/testContractionState.cxx b/test/unit/testContractionState.cxx index 30d5454f9..0fd391906 100644 --- a/test/unit/testContractionState.cxx +++ b/test/unit/testContractionState.cxx @@ -152,6 +152,28 @@ TEST_CASE("ContractionState") { REQUIRE(true == pcs->GetExpanded(3)); } + SECTION("ExpandAll") { + pcs->InsertLines(0,4); + for (int l=0;l<4;l++) { + REQUIRE(true == pcs->GetExpanded(l)); + } + + pcs->SetExpanded(2, false); + REQUIRE(true == pcs->GetExpanded(1)); + REQUIRE(false == pcs->GetExpanded(2)); + REQUIRE(true == pcs->GetExpanded(3)); + + pcs->SetExpanded(1, false); + REQUIRE(false == pcs->GetExpanded(1)); + REQUIRE(false == pcs->GetExpanded(2)); + REQUIRE(true == pcs->GetExpanded(3)); + + REQUIRE(true == pcs->ExpandAll()); + REQUIRE(true == pcs->GetExpanded(1)); + REQUIRE(true == pcs->GetExpanded(2)); + REQUIRE(true == pcs->GetExpanded(3)); + } + SECTION("ChangeHeight") { pcs->InsertLines(0,4); for (int l=0;l<4;l++) { -- cgit v1.2.3