aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/unit/testDecoration.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/testDecoration.cxx')
-rw-r--r--test/unit/testDecoration.cxx45
1 files changed, 45 insertions, 0 deletions
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 <string.h>
+
+#include <stdexcept>
+#include <algorithm>
+
+#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());
+ }
+}