From 78680a6832dafa1cbc3ba6b7fe36144c0d53c9da Mon Sep 17 00:00:00 2001
From: patrick96
Date: Fri, 1 Jun 2018 15:25:11 +0200
Subject: [PATCH] tests: Convert file test to gtest
---
tests/unit_tests/utils/file.cpp | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/tests/unit_tests/utils/file.cpp b/tests/unit_tests/utils/file.cpp
index 47e915ef..ebea3c21 100644
--- a/tests/unit_tests/utils/file.cpp
+++ b/tests/unit_tests/utils/file.cpp
@@ -5,12 +5,13 @@
#include "utils/command.hpp"
#include "utils/file.hpp"
-int main() {
- using namespace polybar;
+using namespace polybar;
- "expand"_test = [] {
- auto cmd = command_util::make_command("echo $HOME");
- cmd->exec();
- cmd->tail([](string home) { expect(file_util::expand("~/test") == home + "/test"); });
- };
+TEST(File, expand) {
+ auto cmd = command_util::make_command("echo $HOME");
+ cmd->exec();
+ cmd->tail([](string home) {
+ EXPECT_EQ(home + "/test", file_util::expand("~/test"));
+ });
}
+