20 void fillMapString(std::map<std::string, bool> & mapStr,
const std::list<std::string> & listStr){
21 for(std::list<std::string>::const_iterator it(listStr.begin()); it != listStr.end(); ++it){
32 bool checkResultSeparator(
const std::string & resultCmd,
const std::string & expectedResult,
char separator){
33 std::list<std::string> listRes =
cutStringList(resultCmd, separator);
34 std::list<std::string> listExpectedRes =
cutStringList(expectedResult, separator);
36 std::map<std::string, bool> mapExpectedRes;
40 for(std::list<std::string>::const_iterator it(listRes.begin()); it != listRes.end(); ++it){
41 b &= mapExpectedRes.find(*it) != mapExpectedRes.end();
52 bool checkResult(
const std::string & resultCmd,
const std::string & expectedResult){
70 const std::string & prevCursorOption,
const std::string & cursorOption,
const std::string & expectedResult)
72 std::string command(program +
" __bashcompletionmode=\""+cursorOption+
"\" __bashcompletionmodeprev=\""+prevCursorOption+
"\" prgName " + partialOption);
92 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"));
93 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"));
94 phoenix_assert(
checkOptionCompletion(PROGRAM_OPTION_COMPLETION_MODE,
"class --config " DIR_COMPLETION
"/0-someDir/someFile.txt",
"--config", DIR_COMPLETION
"/0-someDir/someFile.txt",
"\n"));
95 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"));
96 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"));
100 int main(
int argc,
char** argv){