aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorZufu Liu <unknown>2022-07-24 10:00:06 +1000
committerZufu Liu <unknown>2022-07-24 10:00:06 +1000
commit2a922d679ec36743287191fbd9f67a6fef9f7f1b (patch)
treeb5743e169339ff691913b9fd0a5d59455db73498 /test
parent46e54d394dfd76a0d3055850ce8e6f394dfe2ba7 (diff)
downloadscintilla-mirror-2a922d679ec36743287191fbd9f67a6fef9f7f1b.tar.gz
Bug [#2340] Simplify expand all folds. Speed up expand line a little.
Diffstat (limited to 'test')
-rw-r--r--test/unit/testContractionState.cxx22
1 files changed, 22 insertions, 0 deletions
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++) {