20 for(PVecString::const_iterator it(listStr.begin()); it != listStr.end(); ++it){
35 std::map<PString, bool> mapExpectedRes;
39 for(PVecString::const_iterator it(listRes.begin()); it != listRes.end(); ++it){
40 b &= mapExpectedRes.find(*it) != mapExpectedRes.end();
71 PString command(program +
" __bashcompletionmode=\""+cursorOption+
"\" __bashcompletionmodeprev=\""+prevCursorOption+
"\" prgName " + partialOption);
91 phoenix_assert(
checkOptionCompletion(PROGRAM_OPTION_COMPLETION_MODE,
"class --config " DIR_COMPLETION,
"--config", DIR_COMPLETION, DIR_COMPLETION
"/0-someDir\n" DIR_COMPLETION
"/1-someFile.txt\n\n"));
92 phoenix_assert(
checkOptionCompletion(PROGRAM_OPTION_COMPLETION_MODE,
"class --config " DIR_COMPLETION
"/0-someDir",
"--config", DIR_COMPLETION
"/0-someDir", DIR_COMPLETION
"/0-someDir/someFile.txt\n\n"));
93 phoenix_assert(
checkOptionCompletion(PROGRAM_OPTION_COMPLETION_MODE,
"class --config " DIR_COMPLETION
"/0-someDir/someFile.txt",
"--config", DIR_COMPLETION
"/0-someDir/someFile.txt",
"\n"));
94 phoenix_assert(
checkOptionCompletion(PROGRAM_OPTION_COMPLETION_MODE,
"class --config " DIR_COMPLETION
"/0-someDir/some",
"--config", DIR_COMPLETION
"/0-someDir/some", DIR_COMPLETION
"/0-someDir/someFile.txt\n\n"));
95 phoenix_assert(
checkOptionCompletion(PROGRAM_OPTION_COMPLETION_MODE_DIR,
"class --dir " DIR_COMPLETION
"/0-some",
"--dir", DIR_COMPLETION
"/0-some", DIR_COMPLETION
"/0-someDir\n\n"));
99 int main(
int argc,
char** argv){
std::vector< PString > PVecString
std::vector< PString > split(char separator) const
Cut a PString on the given separator char.
#define phoenix_assert(isOk)
PString phoenix_popen(const PString &command)
Execute the given command and returns the output of this command.
int main(int argc, char **argv)
bool checkOptionCompletion(const PString &program, const PString &partialOption, const PString &prevCursorOption, const PString &cursorOption, const PString &expectedResult)
Check the option completion of a program.
void testCompletion()
Test the completion of the option.
void fillMapString(std::map< PString, bool > &mapStr, const PVecString &listStr)
Create a map with a string.
bool checkResult(const PString &resultCmd, const PString &expectedResult)
Check the restut.
bool checkResultSeparator(const PString &resultCmd, const PString &expectedResult, char separator)
Check the restut.