lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master a1c55fb 2/2: Test printing a path with spaces


From: Greg Chicares
Subject: [lmi-commits] [lmi] master a1c55fb 2/2: Test printing a path with spaces
Date: Thu, 24 Sep 2020 07:32:19 -0400 (EDT)

branch: master
commit a1c55fb3ebb807b9a14304954129a77285eb5d42
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Test printing a path with spaces
    
    With boost::filesystem, initialize_filesystem() must be called first;
    otherwise, the new test would fail.
---
 path_utility_test.cpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/path_utility_test.cpp b/path_utility_test.cpp
index 18ad82a..02ed71e 100644
--- a/path_utility_test.cpp
+++ b/path_utility_test.cpp
@@ -303,11 +303,22 @@ void test_unique_filepath_with_ludicrous_filenames()
 
 void test_path_inserter()
 {
+    {
     char const* z = "/opt/lmi/test/foo.bar";
     fs::path const p(z);
     std::ostringstream oss;
     oss << p;
     BOOST_TEST_EQUAL(z, oss.str());
+    }
+
+    // Ensure that operator<<() works with spaces in path.
+    {
+    char const* z = "/My Opt/lmi/My Tests/My Foo.My Bar";
+    fs::path const p(z);
+    std::ostringstream oss;
+    oss << p;
+    BOOST_TEST_EQUAL(z, oss.str());
+    }
 }
 
 void test_path_validation()
@@ -374,6 +385,8 @@ void test_path_validation()
 
 int test_main(int, char*[])
 {
+    initialize_filesystem();
+
     test_modify_directory();
     test_orthodox_filename();
     test_serial_file_path();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]