From 940593429afdf84615acfe3a95cb0579fc0fd398 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 16 Jun 2020 01:03:39 +0200 Subject: [PATCH] Allow ArgumentParserTests to pass when working dir present within testfiles dir --- testfiles/subdir/foo/bar | 0 tests/argumentparsertests.cpp | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 testfiles/subdir/foo/bar diff --git a/testfiles/subdir/foo/bar b/testfiles/subdir/foo/bar new file mode 100644 index 0000000..e69de29 diff --git a/tests/argumentparsertests.cpp b/tests/argumentparsertests.cpp index dd4c5f1..4bc39f4 100644 --- a/tests/argumentparsertests.cpp +++ b/tests/argumentparsertests.cpp @@ -671,14 +671,14 @@ void ArgumentParserTests::testBashCompletion() } // directory names - string directoryPath = iniFilePath.substr(0, iniFilePath.size() - 4); + string directoryPath = CppUtilities::testFilePath("subdir/foo/bar"); + directoryPath.resize(directoryPath.size() - 4); filesArg.setValueCompletionBehavior(ValueCompletionBehavior::Directories); parser.resetArgs(); const char *const argv14[] = { "get", "--files", directoryPath.c_str() }; { #ifdef CPP_UTILITIES_USE_STANDARD_FILESYSTEM - // order for file names is not specified - const OutputCheck c("COMPREPLY=('" % directoryPath + "subdir' ); compopt -o filenames\n"); + const OutputCheck c("COMPREPLY=('" % directoryPath + "' ); compopt -o filenames\n"); #else const OutputCheck c("COMPREPLY=()\n"); #endif