From a19d2f60cac94dfaf15c26331a2aa7525c66704f Mon Sep 17 00:00:00 2001 From: Robert Andrzejuk Date: Fri, 7 Feb 2025 09:20:30 +0100 Subject: [PATCH] Test the testing the testing framework --- tests/beman/scope/identity.test.cpp | 55 ----------------------------- tests/beman/scope/scope.test.cpp | 13 +++++++ 2 files changed, 13 insertions(+), 55 deletions(-) delete mode 100644 tests/beman/scope/identity.test.cpp create mode 100644 tests/beman/scope/scope.test.cpp diff --git a/tests/beman/scope/identity.test.cpp b/tests/beman/scope/identity.test.cpp deleted file mode 100644 index 8395bfb..0000000 --- a/tests/beman/scope/identity.test.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#include - -#include - -#include -#include - -namespace exe = beman::exemplar; - -TEST(IdentityTest, call_identity_with_int) { - for (int i = -100; i < 100; ++i) { - EXPECT_EQ(i, exe::identity()(i)); - } -} - -TEST(IdentityTest, call_identity_with_custom_type) { - struct S { - int i; - }; - - for (int i = -100; i < 100; ++i) { - const S s{i}; - const S s_id = exe::identity()(s); - EXPECT_EQ(s.i, s_id.i); - } -} - -TEST(IdentityTest, compare_std_vs_beman) { -// Requires: std::identity support. -#if defined(__cpp_lib_identity) - std::identity std_id; - exe::identity beman_id; - for (int i = -100; i < 100; ++i) { - EXPECT_EQ(std_id(i), beman_id(i)); - } -#endif -} - -TEST(IdentityTest, check_is_transparent) { -// Requires: transparent operators support. -#if defined(__cpp_lib_transparent_operators) - - exe::identity id; - - const auto container = {1, 2, 3, 4, 5}; - auto it = std::find(std::begin(container), std::end(container), 3); - EXPECT_EQ(3, *it); - auto it_with_id = std::find(std::begin(container), std::end(container), id(3)); - EXPECT_EQ(3, *it_with_id); - - EXPECT_EQ(it, it_with_id); -#endif -} diff --git a/tests/beman/scope/scope.test.cpp b/tests/beman/scope/scope.test.cpp new file mode 100644 index 0000000..4fa0245 --- /dev/null +++ b/tests/beman/scope/scope.test.cpp @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#include + +#include + + +namespace exe = beman::exemplar; + +TEST(ScopeTest, test_testing_framework) { + EXPECT_TRUE(true); + EXPECT_FALSE(flase); +}