From 7973293c311e27ff08a1488c9759c1b5b0fda30e Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Thu, 5 Jan 2023 13:55:20 +0100 Subject: Added tests --- tests/test-tempfile.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'tests/test-tempfile.cpp') diff --git a/tests/test-tempfile.cpp b/tests/test-tempfile.cpp index b9bef05..782c3de 100644 --- a/tests/test-tempfile.cpp +++ b/tests/test-tempfile.cpp @@ -1,6 +1,6 @@ #include -#include "file.h" +#include "tempfile.h" class TempfileTest: public ::testing::Test { @@ -21,3 +21,16 @@ protected: }; +TEST_F(TempfileTest, getPath) +{ + Reichwein::Tempfile t0; + Reichwein::Tempfile t1{".cpp"}; + Reichwein::Tempfile t2{".cpp"}; + + EXPECT_NE(t0.getPath(), t1.getPath()); + EXPECT_NE(t1.getPath(), t2.getPath()); + + EXPECT_GT(t0.getPath().generic_u8string().size(), 0); + EXPECT_GT(t1.getPath().generic_u8string().size(), 4); + EXPECT_GT(t2.getPath().generic_u8string().size(), 4); +} -- cgit v1.2.3