From 41714e87b6bec47a52a0aebc85517dd3b1d5d336 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 17 Nov 2013 11:17:25 +1100 Subject: Added tests for Decoration. --- test/unit/testDecoration.cxx | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 test/unit/testDecoration.cxx (limited to 'test/unit/testDecoration.cxx') diff --git a/test/unit/testDecoration.cxx b/test/unit/testDecoration.cxx new file mode 100644 index 000000000..769cf8983 --- /dev/null +++ b/test/unit/testDecoration.cxx @@ -0,0 +1,45 @@ +// Unit Tests for Scintilla internal data structures + +#include + +#include +#include + +#include "Platform.h" + +#include "SplitVector.h" +#include "Partitioning.h" +#include "RunStyles.h" +#include "Decoration.h" + +#include "catch.hpp" + +const int indicator=4; + +// Test Decoration. + +TEST_CASE("Decoration") { + + Decoration deco(indicator); + + SECTION("HasCorrectIndicator") { + REQUIRE(indicator == deco.indicator); + } + + SECTION("IsEmptyInitially") { + REQUIRE(0 == deco.rs.Length()); + REQUIRE(1 == deco.rs.Runs()); + REQUIRE(deco.Empty()); + } + + SECTION("SimpleSpace") { + deco.rs.InsertSpace(0, 1); + REQUIRE(deco.Empty()); + } + + SECTION("SimpleRun") { + deco.rs.InsertSpace(0, 1); + deco.rs.SetValueAt(0, 2); + REQUIRE(!deco.Empty()); + } +} -- cgit v1.2.3