diff options
| author | Neil <nyamatongwe@gmail.com> | 2013-11-17 11:17:25 +1100 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2013-11-17 11:17:25 +1100 |
| commit | 41714e87b6bec47a52a0aebc85517dd3b1d5d336 (patch) | |
| tree | 7104cc8b828f51359490fb46f35243ca8b015e0c /test/unit/testDecoration.cxx | |
| parent | 3ef31230a61ce74e2ae8bb116f7b4e338dd69ae6 (diff) | |
| download | scintilla-mirror-41714e87b6bec47a52a0aebc85517dd3b1d5d336.tar.gz | |
Added tests for Decoration.
Diffstat (limited to 'test/unit/testDecoration.cxx')
| -rw-r--r-- | test/unit/testDecoration.cxx | 45 |
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()); + } +} |
