tests: Convert file test to gtest

This commit is contained in:
patrick96 2018-06-01 15:25:11 +02:00 committed by Patrick Ziegler
parent 53c87558c9
commit 78680a6832

View File

@ -5,12 +5,13 @@
#include "utils/command.hpp" #include "utils/command.hpp"
#include "utils/file.hpp" #include "utils/file.hpp"
int main() {
using namespace polybar; using namespace polybar;
"expand"_test = [] { TEST(File, expand) {
auto cmd = command_util::make_command("echo $HOME"); auto cmd = command_util::make_command("echo $HOME");
cmd->exec(); cmd->exec();
cmd->tail([](string home) { expect(file_util::expand("~/test") == home + "/test"); }); cmd->tail([](string home) {
}; EXPECT_EQ(home + "/test", file_util::expand("~/test"));
});
} }