Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/premake-4.x-stable.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/tests/dir_tests.cpp')
-rw-r--r--src/base/tests/dir_tests.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/base/tests/dir_tests.cpp b/src/base/tests/dir_tests.cpp
new file mode 100644
index 0000000..0fc7a21
--- /dev/null
+++ b/src/base/tests/dir_tests.cpp
@@ -0,0 +1,27 @@
+/**
+ * \file dir_tests.cpp
+ * \brief Directory handling automated tests.
+ * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
+ */
+
+#include "premake.h"
+#include "testing/testing.h"
+extern "C" {
+#include "base/dir.h"
+#include "base/cstr.h"
+}
+
+SUITE(base)
+{
+ TEST(DirExists_ReturnsOkay_OnEmptyPath)
+ {
+ int result = dir_exists("");
+ CHECK(result);
+ }
+
+ TEST(DirGetCurrent_ReturnsCurrent_WithSlashes)
+ {
+ const char* result = dir_get_current();
+ CHECK(cstr_ends_with(result, "/src"));
+ }
+}