Merge lp:~azzar1/unity/hud-text-5.0 into lp:unity/5.0

Proposed by Andrea Azzarone
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 2358
Proposed branch: lp:~azzar1/unity/hud-text-5.0
Merge into: lp:unity/5.0
Diff against target: 595 lines (+338/-62)
9 files modified
plugins/unityshell/src/HudButton.cpp (+34/-45)
plugins/unityshell/src/HudButton.h (+19/-17)
plugins/unityshell/src/HudPrivate.cpp (+78/-0)
plugins/unityshell/src/HudPrivate.h (+42/-0)
plugins/unityshell/src/StaticCairoText.cpp (+6/-0)
plugins/unityshell/src/StaticCairoText.h (+1/-0)
tests/CMakeLists.txt (+8/-0)
tests/test_hud_button.cpp (+73/-0)
tests/test_hud_private.cpp (+77/-0)
To merge this branch: bzr merge lp:~azzar1/unity/hud-text-5.0
Reviewer Review Type Date Requested Status
Tim Penhey (community) Approve
Review via email: mp+108126@code.launchpad.net

Commit message

Backports branch lp:~andyrock/unity/hud-text.

Description of the change

Copy pasted from https://code.launchpad.net/~andyrock/unity/hud-text/+merge/107986

== Problem ==
Copy pasted from https://code.launchpad.net/~thumper/unity/hud-text/+merge/106550

The initial work on the hud had the results from the hud service being shown directly. The hud service uses the <b> tag to indicate search matches.

The design, https://launchpadlibrarian.net/93965245/Pangolin_matrix_v1-3e.png had transparent text for not match parts.

== Fix ==
I could add the ability to render text with with transparency in dash::Style but I preferred to use a nux::Layout + nux::StaticCairoText because later we'll need a nux::Layout to show for example shortcuts, etc.

== Test ==
./tests/test-gtest-xless --gtest_filter=TestHudPrivate*
./test/test-getst --gtest_filter=TestHudButton*

== Screenshot ==
http://ubuntuone.com/1Yt5VlOwibqJWbM1P98Hn7

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/HudButton.cpp'
2--- plugins/unityshell/src/HudButton.cpp 2012-03-01 16:14:19 +0000
3+++ plugins/unityshell/src/HudButton.cpp 2012-05-31 09:10:24 +0000
4@@ -26,6 +26,7 @@
5 #include <gtk/gtk.h>
6
7 #include <Nux/Nux.h>
8+#include <Nux/HLayout.h>
9 #include <NuxCore/Logger.h>
10 #include <NuxImage/CairoGraphics.h>
11 #include <NuxGraphics/NuxGraphics.h>
12@@ -33,12 +34,17 @@
13 #include <UnityCore/Variant.h>
14
15 #include "DashStyle.h"
16+#include "StaticCairoText.h"
17
18 #include "HudButton.h"
19+#include "HudPrivate.h"
20
21 namespace
22 {
23 nux::logging::Logger logger("unity.hud.HudButton");
24+
25+const int hlayout_left_padding = 46;
26+const char* const button_font = "Ubuntu 13"; // 17px = 13
27 }
28
29 namespace unity
30@@ -46,44 +52,15 @@
31 namespace hud
32 {
33
34-
35-HudButton::HudButton (nux::TextureArea *image, NUX_FILE_LINE_DECL)
36- : nux::Button (image, NUX_FILE_LINE_PARAM)
37- , is_rounded(false)
38- , is_focused_(false)
39-{
40- Init();
41-}
42-
43-HudButton::HudButton (const std::string label_, NUX_FILE_LINE_DECL)
44- : nux::Button (NUX_FILE_LINE_PARAM)
45- , is_rounded(false)
46- , is_focused_(false)
47-{
48- Init();
49-}
50-
51-HudButton::HudButton (const std::string label_, nux::TextureArea *image, NUX_FILE_LINE_DECL)
52- : nux::Button (image, NUX_FILE_LINE_PARAM)
53- , is_rounded(false)
54- , is_focused_(false)
55-{
56- Init();
57-}
58-
59 HudButton::HudButton (NUX_FILE_LINE_DECL)
60 : nux::Button (NUX_FILE_LINE_PARAM)
61 , is_rounded(false)
62 , is_focused_(false)
63 {
64- Init();
65-}
66-
67-HudButton::~HudButton() {
68-}
69-
70-void HudButton::Init()
71-{
72+ hlayout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
73+ hlayout_->SetLeftAndRightPadding(hlayout_left_padding, -1);
74+ SetLayout(hlayout_);
75+
76 InitTheme();
77 key_nav_focus_change.connect([this](nux::Area *area, bool recieving, nux::KeyNavDirection direction)
78 {
79@@ -96,6 +73,9 @@
80 });
81 }
82
83+HudButton::~HudButton() {
84+}
85+
86 void HudButton::InitTheme()
87 {
88 is_rounded.changed.connect([&] (bool rounded)
89@@ -119,9 +99,9 @@
90
91 void HudButton::RedrawTheme(nux::Geometry const& geom, cairo_t* cr, nux::ButtonVisualState faked_state)
92 {
93- dash::Style::Instance().SquareButton(cr, faked_state, label_,
94- is_rounded, 17,
95- dash::Alignment::LEFT, true);
96+ dash::Style::Instance().SquareButton(cr, faked_state, "",
97+ is_rounded, 17,
98+ dash::Alignment::LEFT, true);
99 }
100
101 bool HudButton::AcceptKeyNavFocus()
102@@ -191,18 +171,27 @@
103 GfxContext.GetRenderStates().SetBlend(alpha, src, dest);
104 }
105
106-void HudButton::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw) {
107-}
108-
109-void HudButton::PostDraw(nux::GraphicsEngine& GfxContext, bool force_draw) {
110- nux::Button::PostDraw(GfxContext, force_draw);
111+void HudButton::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw)
112+{
113+ if (IsFullRedraw())
114+ hlayout_->ProcessDraw(GfxContext, force_draw);
115 }
116
117 void HudButton::SetQuery(Query::Ptr query)
118 {
119 query_ = query;
120- label_ = query->formatted_text;
121 label = query->formatted_text;
122+
123+ auto items(impl::RefactorText(label()));
124+
125+ hlayout_->Clear();
126+ for (auto item : items)
127+ {
128+ nux::StaticCairoText* text = new nux::StaticCairoText(item.first.c_str());
129+ text->SetTextColor(nux::Color(1.0f, 1.0f, 1.0f, item.second ? 1.0f : 0.5f));
130+ text->SetFont(button_font);
131+ hlayout_->AddView(text, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
132+ }
133 }
134
135 Query::Ptr HudButton::GetQuery()
136@@ -219,8 +208,8 @@
137 void HudButton::AddProperties(GVariantBuilder* builder)
138 {
139 variant::BuilderWrapper(builder)
140- .add("label", label_);
141+ .add("label", label());
142 }
143
144-}
145-}
146+} // namespace hud
147+} // namespace unity
148
149=== modified file 'plugins/unityshell/src/HudButton.h'
150--- plugins/unityshell/src/HudButton.h 2012-02-12 17:46:48 +0000
151+++ plugins/unityshell/src/HudButton.h 2012-05-31 09:10:24 +0000
152@@ -29,18 +29,23 @@
153 #include <Nux/Button.h>
154 #include <Nux/TextureArea.h>
155 #include <UnityCore/Hud.h>
156+
157 #include "Introspectable.h"
158
159-namespace unity {
160-namespace hud {
161+namespace nux { class HLayout; }
162+
163+namespace unity
164+{
165+namespace hud
166+{
167+
168 class HudButton : public nux::Button, public unity::debug::Introspectable
169 {
170 typedef nux::ObjectPtr<nux::BaseTexture> BaseTexturePtr;
171+ typedef std::unique_ptr<nux::CairoWrapper> NuxCairoPtr;
172 public:
173 typedef nux::ObjectPtr<HudButton> Ptr;
174- HudButton (nux::TextureArea *image, NUX_FILE_LINE_PROTO);
175- HudButton (const std::string label, NUX_FILE_LINE_PROTO);
176- HudButton (const std::string label, nux::TextureArea *image, NUX_FILE_LINE_PROTO);
177+
178 HudButton (NUX_FILE_LINE_PROTO);
179 virtual ~HudButton();
180
181@@ -51,32 +56,29 @@
182 nux::Property<std::string> hint;
183 nux::Property<bool> is_rounded;
184 nux::Property<bool> fake_focused;
185+
186 protected:
187-
188 virtual bool AcceptKeyNavFocus();
189 virtual long ComputeContentSize();
190 virtual void Draw(nux::GraphicsEngine& GfxContext, bool force_draw);
191 virtual void DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw);
192- virtual void PostDraw(nux::GraphicsEngine& GfxContext, bool force_draw);
193
194 std::string GetName() const;
195 void AddProperties(GVariantBuilder* builder);
196-
197- void Init();
198- void InitTheme ();
199+
200+ void InitTheme();
201 void RedrawTheme(nux::Geometry const& geom, cairo_t* cr, nux::ButtonVisualState faked_state);
202- typedef std::unique_ptr<nux::CairoWrapper> NuxCairoPtr;
203-
204- NuxCairoPtr prelight_;
205- NuxCairoPtr active_;
206- NuxCairoPtr normal_;
207
208 private:
209- std::string label_;
210-
211 Query::Ptr query_;
212 nux::Geometry cached_geometry_;
213 bool is_focused_;
214+
215+ NuxCairoPtr prelight_;
216+ NuxCairoPtr active_;
217+ NuxCairoPtr normal_;
218+
219+ nux::HLayout* hlayout_;
220 };
221 }
222 }
223
224=== added file 'plugins/unityshell/src/HudPrivate.cpp'
225--- plugins/unityshell/src/HudPrivate.cpp 1970-01-01 00:00:00 +0000
226+++ plugins/unityshell/src/HudPrivate.cpp 2012-05-31 09:10:24 +0000
227@@ -0,0 +1,78 @@
228+/*
229+ * Copyright 2012 Canonical Ltd.
230+ *
231+ * This program is free software: you can redistribute it and/or modify it
232+ * under the terms of the GNU Lesser General Public License version 3, as
233+ * published by the Free Software Foundation.
234+ *
235+ * This program is distributed in the hope that it will be useful, but
236+ * WITHOUT ANY WARRANTY; without even the implied warranties of
237+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
238+ * PURPOSE. See the applicable version of the GNU Lesser General Public
239+ * License for more details.
240+ *
241+ * You should have received a copy of both the GNU Lesser General Public
242+ * License version 3 along with this program. If not, see
243+ * <http://www.gnu.org/licenses/>
244+ *
245+ * Authored by: Andrea Azzarone <azzaronea@gmail.com>
246+ * Tim Penhey <tim.penhey@canonical.com>
247+ *
248+ */
249+
250+#include "HudPrivate.h"
251+
252+namespace unity
253+{
254+namespace hud
255+{
256+namespace impl
257+{
258+
259+std::vector<std::pair<std::string, bool>> RefactorText(std::string const& text)
260+{
261+ std::vector<std::pair<std::string, bool>> ret;
262+
263+ static const std::string bold_start("<b>");
264+ static const std::string bold_end("</b>");
265+
266+ std::string::size_type last = 0;
267+ std::string::size_type len = text.length();
268+ std::string::size_type pos = text.find(bold_start);
269+
270+ while (pos != std::string::npos)
271+ {
272+ if (pos != last)
273+ {
274+ ret.push_back(std::pair<std::string, bool>(text.substr(last, pos - last), false));
275+ }
276+
277+ // Look for the end
278+ pos += 3; // // to skip the "<b>"
279+ std::string::size_type end_pos = text.find(bold_end, pos);
280+ // We hope we find it, if we don't, just output everything...
281+ if (end_pos != std::string::npos)
282+ {
283+ ret.push_back(std::pair<std::string, bool>(text.substr(pos, end_pos - pos), true));
284+ last = end_pos + 4; // the length of "</b>"
285+ pos = text.find(bold_start, last);
286+ }
287+ else
288+ {
289+ ret.push_back(std::pair<std::string, bool>(text.substr(pos), true));
290+ pos = std::string::npos;
291+ last = len;
292+ }
293+ }
294+
295+ if (last < len)
296+ {
297+ ret.push_back(std::pair<std::string, bool>(text.substr(last), false));
298+ }
299+
300+ return ret;
301+}
302+
303+} // namespace unity
304+} // namespace hud
305+} // namespace impl
306
307=== added file 'plugins/unityshell/src/HudPrivate.h'
308--- plugins/unityshell/src/HudPrivate.h 1970-01-01 00:00:00 +0000
309+++ plugins/unityshell/src/HudPrivate.h 2012-05-31 09:10:24 +0000
310@@ -0,0 +1,42 @@
311+/*
312+ * Copyright 2012 Canonical Ltd.
313+ *
314+ * This program is free software: you can redistribute it and/or modify it
315+ * under the terms of the GNU Lesser General Public License version 3, as
316+ * published by the Free Software Foundation.
317+ *
318+ * This program is distributed in the hope that it will be useful, but
319+ * WITHOUT ANY WARRANTY; without even the implied warranties of
320+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
321+ * PURPOSE. See the applicable version of the GNU Lesser General Public
322+ * License for more details.
323+ *
324+ * You should have received a copy of both the GNU Lesser General Public
325+ * License version 3 along with this program. If not, see
326+ * <http://www.gnu.org/licenses/>
327+ *
328+ * Authored by: Andrea Azzarone <azzaronea@gmail.com>
329+ *
330+ */
331+
332+#ifndef UNITYSHELL_HUD_PRIVATE_H
333+#define UNITYSHELL_HUD_PRIVATE_H
334+
335+#include <string>
336+#include <utility>
337+#include <vector>
338+
339+namespace unity
340+{
341+namespace hud
342+{
343+namespace impl
344+{
345+
346+std::vector<std::pair<std::string, bool>> RefactorText(std::string const& text);
347+
348+} // namespace impl
349+} // namespace hud
350+} // namespace unity
351+
352+#endif // UNITYSHELL_HUD_PRIVATE_H
353
354=== modified file 'plugins/unityshell/src/StaticCairoText.cpp'
355--- plugins/unityshell/src/StaticCairoText.cpp 2012-04-14 08:48:36 +0000
356+++ plugins/unityshell/src/StaticCairoText.cpp 2012-05-31 09:10:24 +0000
357@@ -245,6 +245,12 @@
358 return _text;
359 }
360
361+nux::Color StaticCairoText::GetTextColor() const
362+{
363+ return _textColor;
364+}
365+
366+
367 void
368 StaticCairoText::SetTextColor(Color const& textColor)
369 {
370
371=== modified file 'plugins/unityshell/src/StaticCairoText.h'
372--- plugins/unityshell/src/StaticCairoText.h 2012-03-14 06:24:18 +0000
373+++ plugins/unityshell/src/StaticCairoText.h 2012-05-31 09:10:24 +0000
374@@ -86,6 +86,7 @@
375 void SetLines(int maximum_lines);
376
377 std::string GetText() const;
378+ nux::Color GetTextColor() const;
379
380 int GetLineCount();
381 int GetBaseline() const;
382
383=== modified file 'tests/CMakeLists.txt'
384--- tests/CMakeLists.txt 2012-05-23 13:11:59 +0000
385+++ tests/CMakeLists.txt 2012-05-31 09:10:24 +0000
386@@ -143,6 +143,7 @@
387 test_grabhandle.cpp
388 test_unityshell_private.cpp
389 test_showdesktop_handler.cpp
390+ test_hud_private.cpp
391 ${UNITY_SRC}/AbstractLauncherIcon.cpp
392 ${UNITY_SRC}/AbstractShortcutHint.h
393 ${UNITY_SRC}/Animator.cpp
394@@ -151,6 +152,7 @@
395 ${UNITY_SRC}/FavoriteStore.cpp
396 ${UNITY_SRC}/FavoriteStoreGSettings.cpp
397 ${UNITY_SRC}/IconTextureSource.cpp
398+ ${UNITY_SRC}/HudPrivate.cpp
399 ${UNITY_SRC}/LauncherModel.cpp
400 ${UNITY_SRC}/LauncherEntryRemote.cpp
401 ${UNITY_SRC}/FavoriteStorePrivate.cpp
402@@ -194,6 +196,7 @@
403
404 # Tests that require X
405 add_executable(test-gtest
406+ test_hud_button.cpp
407 test_dashview_impl.cpp
408 test_texture_cache.cpp
409 test_main.cpp
410@@ -207,6 +210,8 @@
411 ${UNITY_SRC}/AbstractPlacesGroup.cpp
412 ${UNITY_SRC}/BackgroundEffectHelper.cpp
413 ${UNITY_SRC}/CairoBaseWindow.cpp
414+ ${UNITY_SRC}/DashSettings.cpp
415+ ${UNITY_SRC}/DashStyle.cpp
416 ${UNITY_SRC}/DashViewPrivate.cpp
417 ${UNITY_SRC}/Decaymulator.cpp
418 ${UNITY_SRC}/DNDCollectionWindow.cpp
419@@ -216,6 +221,8 @@
420 ${UNITY_SRC}/IconRenderer.cpp
421 ${UNITY_SRC}/IconTextureSource.cpp
422 ${UNITY_SRC}/Introspectable.cpp
423+ ${UNITY_SRC}/HudButton.cpp
424+ ${UNITY_SRC}/HudPrivate.cpp
425 ${UNITY_SRC}/LayoutSystem.cpp
426 ${UNITY_SRC}/Launcher.cpp
427 ${UNITY_SRC}/LauncherDragWindow.cpp
428@@ -224,6 +231,7 @@
429 ${UNITY_SRC}/LauncherHoverMachine.cpp
430 ${UNITY_SRC}/LauncherIcon.cpp
431 ${UNITY_SRC}/LauncherModel.cpp
432+ ${UNITY_SRC}/JSONParser.cpp
433 ${UNITY_SRC}/SimpleLauncherIcon.cpp
434 ${UNITY_SRC}/SingleMonitorLauncherIcon.cpp
435 ${UNITY_SRC}/LensViewPrivate.cpp
436
437=== added file 'tests/test_hud_button.cpp'
438--- tests/test_hud_button.cpp 1970-01-01 00:00:00 +0000
439+++ tests/test_hud_button.cpp 2012-05-31 09:10:24 +0000
440@@ -0,0 +1,73 @@
441+/*
442+ * Copyright 2012 Canonical Ltd.
443+ *
444+ * This program is free software: you can redistribute it and/or modify it
445+ * under the terms of the GNU Lesser General Public License version 3, as
446+ * published by the Free Software Foundation.
447+ *
448+ * This program is distributed in the hope that it will be useful, but
449+ * WITHOUT ANY WARRANTY; without even the implied warranties of
450+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
451+ * PURPOSE. See the applicable version of the GNU Lesser General Public
452+ * License for more details.
453+ *
454+ * You should have received a copy of both the GNU Lesser General Public
455+ * License version 3 along with this program. If not, see
456+ * <http://www.gnu.org/licenses/>
457+ *
458+ * Authored by: Andrea Azzarone <azzaronea@gmail.com>
459+ *
460+ */
461+
462+#include <gtest/gtest.h>
463+
464+#include <Nux/Nux.h>
465+#include <Nux/Layout.h>
466+#include <UnityCore/Hud.h>
467+
468+#include "HudButton.h"
469+#include "DashStyle.h"
470+#include "StaticCairoText.h"
471+#include "DashSettings.h"
472+
473+using namespace unity;
474+
475+namespace
476+{
477+
478+TEST(TestHudButton, TestLabelOpacity)
479+{
480+ dash::Settings unity_settings;
481+ dash::Style dash_style;
482+ nux::ObjectPtr<hud::HudButton> button(new hud::HudButton());
483+ nux::Layout* layout = button->GetLayout();
484+
485+ ASSERT_NE(layout, nullptr);
486+ ASSERT_EQ(layout->GetChildren().size(), 0);
487+
488+ hud::Query::Ptr query(new hud::Query("<b>Op</b> Fi<b>le</b>", "","", "", "", NULL));
489+ button->SetQuery(query);
490+
491+ auto children(layout->GetChildren());
492+ ASSERT_EQ(children.size(), 3);
493+
494+ auto it = children.begin();
495+ nux::StaticCairoText* label = dynamic_cast<nux::StaticCairoText*>(*it);
496+ ASSERT_NE(label, nullptr);
497+ EXPECT_EQ(label->GetText(), "Op");
498+ EXPECT_EQ(label->GetTextColor().alpha, 1.0f);
499+
500+ it++;
501+ label = dynamic_cast<nux::StaticCairoText*>(*it);
502+ ASSERT_NE(label, nullptr);
503+ EXPECT_EQ(label->GetText(), " Fi");
504+ EXPECT_EQ(label->GetTextColor().alpha, 0.5f);
505+
506+ it++;
507+ label = dynamic_cast<nux::StaticCairoText*>(*it);
508+ ASSERT_NE(label, nullptr);
509+ EXPECT_EQ(label->GetText(), "le");
510+ EXPECT_EQ(label->GetTextColor().alpha, 1.0f);
511+}
512+
513+}
514
515=== added file 'tests/test_hud_private.cpp'
516--- tests/test_hud_private.cpp 1970-01-01 00:00:00 +0000
517+++ tests/test_hud_private.cpp 2012-05-31 09:10:24 +0000
518@@ -0,0 +1,77 @@
519+/*
520+ * Copyright 2012 Canonical Ltd.
521+ *
522+ * This program is free software: you can redistribute it and/or modify it
523+ * under the terms of the GNU Lesser General Public License version 3, as
524+ * published by the Free Software Foundation.
525+ *
526+ * This program is distributed in the hope that it will be useful, but
527+ * WITHOUT ANY WARRANTY; without even the implied warranties of
528+ * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
529+ * PURPOSE. See the applicable version of the GNU Lesser General Public
530+ * License for more details.
531+ *
532+ * You should have received a copy of both the GNU Lesser General Public
533+ * License version 3 along with this program. If not, see
534+ * <http://www.gnu.org/licenses/>
535+ *
536+ * Authored by: Andrea Azzarone <azzaronea@gmail.com>
537+ *
538+ */
539+
540+#include <gtest/gtest.h>
541+
542+#include "HudPrivate.h"
543+using namespace unity::hud;
544+
545+namespace
546+{
547+
548+TEST(TestHudPrivate, RefactorTextEmpty)
549+{
550+ std::vector<std::pair<std::string, bool>> temp;
551+
552+ temp = impl::RefactorText("");
553+ ASSERT_EQ(temp.size(), 0);
554+
555+ temp = impl::RefactorText("Test");
556+ ASSERT_EQ(temp.size(), 1);
557+ EXPECT_EQ(temp[0].first, "Test");
558+ EXPECT_EQ(temp[0].second, false); // True means "Full opacity", false "Half opacity"
559+
560+ temp = impl::RefactorText("<b>Test</b>");
561+ ASSERT_EQ(temp.size(), 1);
562+ EXPECT_EQ(temp[0].first, "Test");
563+ EXPECT_EQ(temp[0].second, true);
564+
565+ temp = impl::RefactorText("Hello > <b>Test</b> World");
566+ ASSERT_EQ(temp.size(), 3);
567+ EXPECT_EQ(temp[0].first, "Hello > ");
568+ EXPECT_EQ(temp[0].second, false);
569+ EXPECT_EQ(temp[1].first, "Test");
570+ EXPECT_EQ(temp[1].second, true);
571+ EXPECT_EQ(temp[2].first, " World");
572+ EXPECT_EQ(temp[2].second, false);
573+
574+ temp = impl::RefactorText("Open <b>Fi</b>le <b>Wit</b>h");
575+ ASSERT_EQ(temp.size(), 5);
576+ EXPECT_EQ(temp[0].first, "Open ");
577+ EXPECT_EQ(temp[0].second, false);
578+ EXPECT_EQ(temp[1].first, "Fi");
579+ EXPECT_EQ(temp[1].second, true);
580+ EXPECT_EQ(temp[2].first, "le ");
581+ EXPECT_EQ(temp[2].second, false);
582+ EXPECT_EQ(temp[3].first, "Wit");
583+ EXPECT_EQ(temp[3].second, true);
584+ EXPECT_EQ(temp[4].first, "h");
585+ EXPECT_EQ(temp[4].second, false);
586+
587+ temp = impl::RefactorText("Open <b>File With");
588+ ASSERT_EQ(temp.size(), 2);
589+ EXPECT_EQ(temp[0].first, "Open ");
590+ EXPECT_EQ(temp[0].second, false);
591+ EXPECT_EQ(temp[1].first, "File With");
592+ EXPECT_EQ(temp[1].second, true);
593+}
594+
595+}

Subscribers

People subscribed via source and target branches

to all changes: