From b84c414f2e4d8461f6a6cd44e5deb81a1753bce4 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Tue, 5 Nov 2019 09:53:41 +0000 Subject: [PATCH] Add unit test for 7003255c0e6d9e80295d04ee416f25db38fa7b0d (#4096) --- test/unit/text/script_runs.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/unit/text/script_runs.cpp b/test/unit/text/script_runs.cpp index e9bbcb030..dd40e1b1e 100644 --- a/test/unit/text/script_runs.cpp +++ b/test/unit/text/script_runs.cpp @@ -31,3 +31,18 @@ TEST_CASE("many punctuation chars") CHECK(runs.getScriptEnd() == text.length()); } } + +TEST_CASE("empty runs") +{ + mapnik::value_unicode_string text("()text"); + ScriptRun runs(text.getBuffer(), text.length()); + std::size_t count = 0; + std::size_t size = 0; + while (runs.next()) + { + size += runs.getScriptEnd() - runs.getScriptStart(); + ++count; + } + REQUIRE(count == 1); + REQUIRE(size == text.length()); +}