execute IWYU and add some coverage tests.

This commit is contained in:
ArthurSonzogni
2022-04-27 18:57:48 +02:00
parent 84d6e6b3dd
commit d0890f94d1
20 changed files with 124 additions and 96 deletions

View File

@@ -1,9 +1,9 @@
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
#include <string> // for allocator
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
namespace ftxui {
@@ -11,10 +11,10 @@ TEST(BlinkTest, Basic) {
auto element = text("text") | blink;
Screen screen(5, 1);
Render(screen, element);
EXPECT_TRUE(screen.PixelAt(0,0).blink);
EXPECT_TRUE(screen.PixelAt(0, 0).blink);
}
} // namespace ftxui
} // namespace ftxui
// Copyright 2022 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in

View File

@@ -1,9 +1,9 @@
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
#include <string> // for allocator
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
namespace ftxui {
@@ -11,10 +11,10 @@ TEST(BoldTest, Basic) {
auto element = text("text") | bold;
Screen screen(5, 1);
Render(screen, element);
EXPECT_TRUE(screen.PixelAt(0,0).bold);
EXPECT_TRUE(screen.PixelAt(0, 0).bold);
}
} // namespace ftxui
} // namespace ftxui
// Copyright 2022 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in

View File

@@ -1,9 +1,9 @@
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
#include <string> // for allocator
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
namespace ftxui {
@@ -99,7 +99,7 @@ TEST(BorderTest, Window) {
"╰────────╯");
}
} // namespace ftxui
} // namespace ftxui
// Copyright 2022 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in

View File

@@ -1,9 +1,9 @@
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
#include <string> // for allocator
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
namespace ftxui {
@@ -16,7 +16,7 @@ uint32_t Hash(const std::string s) {
}
return hash;
}
}
} // namespace
TEST(CanvasTest, GoldPoint) {
Terminal::SetColorSupport(Terminal::Color::TrueColor);
@@ -40,7 +40,7 @@ TEST(CanvasTest, GoldPointColor) {
Terminal::SetColorSupport(Terminal::Color::TrueColor);
auto element = canvas([](Canvas& c) { //
c.DrawPoint(3, 3, 1, Color::Red);
c.DrawPointLine(3, 7, 10, 19,Color::Blue);
c.DrawPointLine(3, 7, 10, 19, Color::Blue);
c.DrawPointCircle(10, 5, 3, Color::Yellow);
c.DrawPointCircleFilled(20, 5, 3, Color::White);
c.DrawPointEllipse(10, 10, 5, 2, Color::Black);
@@ -84,7 +84,6 @@ TEST(CanvasTest, GoldBlockColor) {
EXPECT_EQ(Hash(screen.ToString()), 2869205941);
}
TEST(CanvasTest, GoldText) {
Terminal::SetColorSupport(Terminal::Color::TrueColor);
Canvas c(10, 10);
@@ -97,7 +96,7 @@ TEST(CanvasTest, GoldText) {
EXPECT_EQ(Hash(screen.ToString()), 1074960375);
}
} // namespace ftxui
} // namespace ftxui
// Copyright 2022 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in

View File

@@ -1,9 +1,9 @@
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
#include <string> // for allocator
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
namespace ftxui {
@@ -23,7 +23,7 @@ TEST(ColorTest, Background) {
EXPECT_EQ(screen.PixelAt(0, 0).background_color, Color::Red);
}
} // namespace ftxui
} // namespace ftxui
// Copyright 2022 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in

View File

@@ -1,9 +1,9 @@
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
#include <string> // for allocator
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
namespace ftxui {
@@ -11,10 +11,10 @@ TEST(DimTest, Basic) {
auto element = text("text") | dim;
Screen screen(5, 1);
Render(screen, element);
EXPECT_TRUE(screen.PixelAt(0,0).dim);
EXPECT_TRUE(screen.PixelAt(0, 0).dim);
}
} // namespace ftxui
} // namespace ftxui
// Copyright 2022 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in

View File

@@ -358,7 +358,6 @@ void Compute(Global& global) {
Compute1(global);
}
} // namespace ftxui::flexbox_helper
// Copyright 2021 Arthur Sonzogni. All rights reserved.

View File

@@ -1,9 +1,9 @@
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
#include <string> // for allocator
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
namespace ftxui {

View File

@@ -1,9 +1,9 @@
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
#include <string> // for allocator
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
namespace ftxui {
@@ -107,7 +107,7 @@ TEST(SeparatorTest, WithPixel) {
"down");
}
} // namespace ftxui
} // namespace ftxui
// Copyright 2022 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in

View File

@@ -1,9 +1,9 @@
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
#include <string> // for allocator
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
namespace ftxui {
@@ -35,7 +35,7 @@ TEST(SpinnerTest, Spinner4) {
EXPECT_EQ(screen.ToString(), ". ");
}
} // namespace ftxui
} // namespace ftxui
// Copyright 2022 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in

View File

@@ -1,9 +1,9 @@
#include <gtest/gtest-message.h> // for Message
#include <gtest/gtest-test-part.h> // for SuiteApiResolver, TestFactoryImpl, TestPartResult
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
#include <string> // for allocator
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "ftxui/dom/elements.hpp" // for text, flexbox
#include "ftxui/screen/screen.hpp" // for Screen
#include "gtest/gtest_pred_impl.h" // for Test, EXPECT_EQ, TEST
namespace ftxui {
@@ -11,10 +11,10 @@ TEST(UnderlinedTest, Basic) {
auto element = text("text") | underlined;
Screen screen(5, 1);
Render(screen, element);
EXPECT_TRUE(screen.PixelAt(0,0).underlined);
EXPECT_TRUE(screen.PixelAt(0, 0).underlined);
}
} // namespace ftxui
} // namespace ftxui
// Copyright 2022 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in