Code Cleanup

- Removed unused uti.cpp indentTree function.
This commit is contained in:
Paul Beckingham 2014-09-07 17:32:46 -04:00
parent adee92a6b9
commit e15907f3f1
3 changed files with 1 additions and 37 deletions

View file

@ -347,20 +347,6 @@ int execute (
// - delimiter is the character used to split up projects into subprojects.
// - defaults to the period, '.'
//
const std::vector<std::string> indentTree (
const std::vector<std::string>& values,
const std::string& whitespace /* = " " */,
char delimiter/* = '.' */)
{
std::vector <std::string> modified;
std::vector <std::string>::const_iterator i;
for (i = values.begin (); i != values.end (); ++i)
modified.push_back (indentProject (*i, whitespace, delimiter));
return modified;
}
////////////////////////////////////////////////////////////////////////////////
const std::string indentProject (
const std::string& project,
const std::string& whitespace /* = " " */,

View file

@ -61,11 +61,6 @@ int execute (const std::string&, const std::vector <std::string>&, const std::st
int flock (int, int);
#endif
const std::vector<std::string> indentTree (
const std::vector<std::string>&,
const std::string& whitespace = " ",
char delimiter = '.');
const std::string indentProject (
const std::string&,
const std::string& whitespace = " ",

View file

@ -36,7 +36,7 @@ Context context;
////////////////////////////////////////////////////////////////////////////////
int main (int argc, char** argv)
{
UnitTest t (29);
UnitTest t (23);
// Ensure environment has no influence.
unsetenv ("TASKDATA");
@ -89,23 +89,6 @@ int main (int argc, char** argv)
output = taskDifferences (right, rightAgain);
t.ok (output.find ("No changes will be made") != std::string::npos, "No changes detected");
// see also indirect tests of indentProject and extractParents in `project.t'.
// std::vector<std::string> indentTree (const std::vector<std::string>&, const std::string whitespace=" ", char delimiter='.');
std::vector <std::string> flat;
flat.push_back ("one");
flat.push_back ("one.two");
flat.push_back ("one.two.three");
flat.push_back ("one.four");
flat.push_back ("two");
std::vector <std::string> structured = indentTree (flat, " ", '.');
t.is (structured.size (), (size_t) 5, "indentTree yields 5 strings");
t.is (structured[0], "one", "indentTree 'one' -> 'one'");
t.is (structured[1], " two", "indentTree 'one.two' -> ' two'");
t.is (structured[2], " three", "indentTree 'one.two.three' -> ' three'");
t.is (structured[3], " four", "indentTree 'one.four' -> ' four'");
t.is (structured[4], "two", "indentTree 'two' -> 'two'");
// std::vector<std::string> indentProject (const std::string&, const std::string whitespace=" ", char delimiter='.');
t.is (indentProject (""), "", "indentProject '' -> ''");
t.is (indentProject ("one"), "one", "indentProject 'one' -> 'one'");