From 7c30a49a688384e5b2c0c573b3ec7ce400c01f7b Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 7 Jun 2011 11:48:54 +1000 Subject: Add tests for bug found in #3291579 and for new RunStyles::Find and ContractionState::HiddenLines methods. --- test/unit/testContractionState.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/unit/testContractionState.cxx') diff --git a/test/unit/testContractionState.cxx b/test/unit/testContractionState.cxx index 96a7bbf8a..bd3b6f111 100644 --- a/test/unit/testContractionState.cxx +++ b/test/unit/testContractionState.cxx @@ -76,6 +76,7 @@ TEST_F(ContractionStateTest, ShowHide) { EXPECT_EQ(0, pcs->GetVisible(1)); EXPECT_EQ(true, pcs->GetVisible(2)); EXPECT_EQ(4, pcs->LinesDisplayed()); + EXPECT_EQ(1, pcs->HiddenLines()); pcs->SetVisible(1, 2, true); for (int l=0;l<4;l++) { @@ -88,6 +89,26 @@ TEST_F(ContractionStateTest, ShowHide) { for (int l=0;l<4;l++) { EXPECT_EQ(true, pcs->GetVisible(0)); } + EXPECT_EQ(0, pcs->HiddenLines()); +} + +TEST_F(ContractionStateTest, Hidden) { + pcs->InsertLines(0,1); + for (int l=0;l<2;l++) { + EXPECT_EQ(true, pcs->GetVisible(0)); + } + EXPECT_EQ(0, pcs->HiddenLines()); + + pcs->SetVisible(1, 1, false); + EXPECT_EQ(true, pcs->GetVisible(0)); + EXPECT_EQ(0, pcs->GetVisible(1)); + EXPECT_EQ(1, pcs->HiddenLines()); + + pcs->SetVisible(1, 1, true); + for (int l=0;l<2;l++) { + EXPECT_EQ(true, pcs->GetVisible(0)); + } + EXPECT_EQ(0, pcs->HiddenLines()); } TEST_F(ContractionStateTest, Contracting) { -- cgit v1.2.3