From d4fc66af3924805d40576989c1e139ddafcc4670 Mon Sep 17 00:00:00 2001 From: Chris Loer Date: Wed, 16 Nov 2016 12:50:57 -0800 Subject: [core] Add minimal line breaking support for RTL text. --- test/util/merge_lines.test.cpp | 48 +++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'test/util/merge_lines.test.cpp') diff --git a/test/util/merge_lines.test.cpp b/test/util/merge_lines.test.cpp index 30cd1af068..8383183e0a 100644 --- a/test/util/merge_lines.test.cpp +++ b/test/util/merge_lines.test.cpp @@ -9,21 +9,21 @@ const std::u16string bbb = u"b"; TEST(MergeLines, SameText) { // merges lines with the same text std::vector input1 = { - { {{{0, 0}, {1, 0}, {2, 0}}}, aaa, {}, 0 }, - { {{{4, 0}, {5, 0}, {6, 0}}}, bbb, {}, 0 }, - { {{{8, 0}, {9, 0}}}, aaa, {}, 0 }, - { {{{2, 0}, {3, 0}, {4, 0}}}, aaa, {}, 0 }, - { {{{6, 0}, {7, 0}, {8, 0}}}, aaa, {}, 0 }, - { {{{5, 0}, {6, 0}}}, aaa, {}, 0 } + { {{{0, 0}, {1, 0}, {2, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{{4, 0}, {5, 0}, {6, 0}}}, bbb, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{{8, 0}, {9, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{{2, 0}, {3, 0}, {4, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{{6, 0}, {7, 0}, {8, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{{5, 0}, {6, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 } }; const std::vector expected1 = { - { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}}, aaa, {}, 0 }, - { {{{4, 0}, {5, 0}, {6, 0}}}, bbb, {}, 0 }, - { {{{5, 0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}}}, aaa, {}, 0 }, - { {{}}, aaa, {}, 0 }, - { {{}}, aaa, {}, 0 }, - { {{}}, aaa, {}, 0 } + { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{{4, 0}, {5, 0}, {6, 0}}}, bbb, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{{5, 0}, {6, 0}, {7, 0}, {8, 0}, {9, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 } }; mbgl::util::mergeLines(input1); @@ -36,15 +36,15 @@ TEST(MergeLines, SameText) { TEST(MergeLines, BothEnds) { // mergeLines handles merge from both ends std::vector input2 = { - { {{{0, 0}, {1, 0}, {2, 0}}}, aaa, {}, 0 }, - { {{{4, 0}, {5, 0}, {6, 0}}}, aaa, {}, 0 }, - { {{{2, 0}, {3, 0}, {4, 0}}}, aaa, {}, 0 } + { {{{0, 0}, {1, 0}, {2, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{{4, 0}, {5, 0}, {6, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{{2, 0}, {3, 0}, {4, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 } }; const std::vector expected2 = { - { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}}}, aaa, {}, 0 }, - { {{}}, aaa, {}, 0 }, - { {{}}, aaa, {}, 0 } + { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 } }; mbgl::util::mergeLines(input2); @@ -57,15 +57,15 @@ TEST(MergeLines, BothEnds) { TEST(MergeLines, CircularLines) { // mergeLines handles circular lines std::vector input3 = { - { {{{0, 0}, {1, 0}, {2, 0}}}, aaa, {}, 0 }, - { {{{2, 0}, {3, 0}, {4, 0}}}, aaa, {}, 0 }, - { {{{4, 0}, {0, 0}}}, aaa, {}, 0 } + { {{{0, 0}, {1, 0}, {2, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{{2, 0}, {3, 0}, {4, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{{4, 0}, {0, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 } }; const std::vector expected3 = { - { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {0, 0}}}, aaa, {}, 0 }, - { {{}}, aaa, {}, 0 }, - { {{}}, aaa, {}, 0 } + { {{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {0, 0}}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 }, + { {{}}, aaa, mbgl::WritingDirection::LeftToRight, {}, 0 } }; mbgl::util::mergeLines(input3); -- cgit v1.2.1