Remove googletest (#178)

This commit is contained in:
ykiko
2025-08-16 23:09:13 +08:00
committed by GitHub
parent e77f182fcd
commit 08b41f15c2
46 changed files with 4446 additions and 4285 deletions

View File

@@ -6,39 +6,41 @@ namespace clice::testing {
namespace {
TEST(Async, FileSystemRead) {
auto path = fs::createTemporaryFile("prefix", "suffix");
EXPECT_TRUE(path.has_value());
suite<"Async"> suite = [] {
test("FileSystemRead") = [] {
auto path = fs::createTemporaryFile("prefix", "suffix");
expect(that % path.has_value());
auto result = fs::write(*path, "hello");
EXPECT_TRUE(result.has_value());
auto result = fs::write(*path, "hello");
expect(that % result.has_value());
auto main = [&] -> async::Task<> {
auto content = co_await async::fs::read(*path);
EXPECT_TRUE(content.has_value());
EXPECT_EQ(*content, "hello");
auto main = [&] -> async::Task<> {
auto content = co_await async::fs::read(*path);
expect(that % content.has_value());
expect(that % *content == std::string_view("hello"));
};
async::run(main());
};
async::run(main());
}
test("FileSystemWrite") = [] {
auto path = fs::createTemporaryFile("prefix", "suffix");
expect(that % path.has_value());
TEST(Async, FileSystemWrite) {
auto path = fs::createTemporaryFile("prefix", "suffix");
EXPECT_TRUE(path.has_value());
auto main = [&] -> async::Task<> {
char buffer[] = "hello";
auto main = [&] -> async::Task<> {
char buffer[] = "hello";
auto result = co_await async::fs::write(*path, buffer, 5);
expect(that % result.has_value());
};
auto result = co_await async::fs::write(*path, buffer, 5);
EXPECT_TRUE(result.has_value());
async::run(main());
auto content = fs::read(*path);
expect(that % content.has_value());
expect(that % *content == std::string_view("hello"));
};
async::run(main());
auto content = fs::read(*path);
EXPECT_TRUE(content.has_value());
EXPECT_EQ(*content, "hello");
}
};
} // namespace