From 18577912a9129d5c92f4e505b6b47d755a337533 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Tue, 21 Nov 2023 21:02:43 +0100 Subject: [PATCH] chore: Remove obsolete Util::is_dir_separator --- src/Util.hpp | 12 ------------ unittest/test_Util.cpp | 11 ----------- 2 files changed, 23 deletions(-) diff --git a/src/Util.hpp b/src/Util.hpp index 6159390f0..48e543cec 100644 --- a/src/Util.hpp +++ b/src/Util.hpp @@ -63,18 +63,6 @@ std::string get_relative_path(std::string_view dir, std::string_view path); // point. std::optional is_absolute_path_with_prefix(std::string_view path); -// Return whether `ch` is a directory separator, i.e. '/' on POSIX systems and -// '/' or '\\' on Windows systems. -inline bool -is_dir_separator(char ch) -{ - return ch == '/' -#ifdef _WIN32 - || ch == '\\' -#endif - ; -} - // Construct a normalized native path. // // Example: diff --git a/unittest/test_Util.cpp b/unittest/test_Util.cpp index d258e2e5e..ba5949536 100644 --- a/unittest/test_Util.cpp +++ b/unittest/test_Util.cpp @@ -169,17 +169,6 @@ TEST_CASE("Util::is_absolute_path_with_prefix") #endif } -TEST_CASE("Util::is_dir_separator") -{ - CHECK(!Util::is_dir_separator('x')); - CHECK(Util::is_dir_separator('/')); -#ifdef _WIN32 - CHECK(Util::is_dir_separator('\\')); -#else - CHECK(!Util::is_dir_separator('\\')); -#endif -} - TEST_CASE("Util::make_relative_path") { using Util::make_relative_path; -- 2.47.2