Switch from linenoise to replxx
Change-Id: Id3e04eca8dbd7e68cef080713296fef3fdc683c5
diff --git a/tests/command_completion.cpp b/tests/command_completion.cpp
index f3cc868..21410c8 100644
--- a/tests/command_completion.cpp
+++ b/tests/command_completion.cpp
@@ -32,13 +32,13 @@
SECTION("c")
{
input = "c";
- expected = {"d", "ommit", "reate"};
+ expected = {"cd", "commit", "create"};
}
SECTION("d")
{
input = "d";
- expected = {"elete", "iscard"};
+ expected = {"delete", "discard"};
}
SECTION("x")
@@ -51,13 +51,13 @@
{
input = "cd";
// TODO: depending on how Readline works, this will have to be changed to include a space
- expected = {""};
+ expected = {"cd"};
}
SECTION("create")
{
input = "create";
- expected = {""};
+ expected = {"create"};
}
REQUIRE(parser.completeCommand(input, errorStream) == expected);
diff --git a/tests/path_completion.cpp b/tests/path_completion.cpp
index 7a9090b..e0faf15 100644
--- a/tests/path_completion.cpp
+++ b/tests/path_completion.cpp
@@ -44,19 +44,19 @@
SECTION("ls e")
{
input = "ls e";
- expected = {"xample:ano", "xample:anoda", "xample:bota", "xample:list", "xample:twoKeyList"};
+ expected = {"example:ano", "example:anoda", "example:bota", "example:list", "example:twoKeyList"};
}
SECTION("ls example:ano")
{
input = "ls example:ano";
- expected = {"", "da"};
+ expected = {"example:ano", "example:anoda"};
}
SECTION("ls example:ano/example:a")
{
input = "ls example:ano/example:a";
- expected = {"2"};
+ expected = {"example:a2"};
}
SECTION("ls x")
@@ -74,13 +74,13 @@
SECTION("ls /e")
{
input = "ls /e";
- expected = {"xample:ano", "xample:anoda", "xample:bota", "xample:list", "xample:twoKeyList"};
+ expected = {"example:ano", "example:anoda", "example:bota", "example:list", "example:twoKeyList"};
}
SECTION("ls /s")
{
input = "ls /s";
- expected = {"econd:amelie"};
+ expected = {"second:amelie"};
}
SECTION("ls /example:list[number=3]/")
@@ -92,7 +92,7 @@
SECTION("ls /example:list[number=3]/c")
{
input = "ls /example:list[number=3]/e";
- expected = {"xample:contInList"};
+ expected = {"example:contInList"};
}
SECTION("ls /example:list[number=3]/a")
@@ -107,7 +107,7 @@
SECTION("cd example:lis")
{
input = "cd example:lis";
- expected = {"t"};
+ expected = {"example:list"};
}
SECTION("cd example:list[")
@@ -119,13 +119,13 @@
SECTION("cd example:list[numb")
{
input = "cd example:list[numb";
- expected = {"er="};
+ expected = {"number="};
}
SECTION("cd example:list[number")
{
input = "cd example:list[number";
- expected = {"="};
+ expected = {"number="};
}
SECTION("cd example:list[number=12")
@@ -137,7 +137,7 @@
SECTION("cd example:list[number=12]")
{
input = "cd example:list[number=12]";
- expected = {"/"};
+ expected = {"]/"};
}
SECTION("cd example:twoKeyList[")
@@ -167,7 +167,7 @@
SECTION("cd example:twoKeyList[name=\"AHOJ\"][number=123]")
{
input = "cd example:twoKeyList[name=\"AHOJ\"][number=123]";
- expected = {"/"};
+ expected = {"]/"};
}
}
diff --git a/tests/utils.cpp b/tests/utils.cpp
index 62e4c23..b7ce8fb 100644
--- a/tests/utils.cpp
+++ b/tests/utils.cpp
@@ -11,17 +11,16 @@
TEST_CASE("utils")
{
- SECTION("filterAndErasePrefix")
+ SECTION("filterByPrefix")
{
std::set<std::string> set{"ahoj", "coze", "copak", "aha", "polivka"};
- REQUIRE((filterAndErasePrefix(set, "a") == std::set<std::string>{"hoj", "ha"}));
- REQUIRE((filterAndErasePrefix(set, "ah") == std::set<std::string>{"oj", "a"}));
- REQUIRE((filterAndErasePrefix(set, "aho") == std::set<std::string>{"j"}));
- REQUIRE((filterAndErasePrefix(set, "polivka") == std::set<std::string>{""}));
- REQUIRE((filterAndErasePrefix(set, "polivka") == std::set<std::string>{""}));
- REQUIRE((filterAndErasePrefix(set, "polivkax") == std::set<std::string>{}));
- REQUIRE((filterAndErasePrefix(set, "co") == std::set<std::string>{"pak", "ze"}));
+ REQUIRE((filterByPrefix(set, "a") == std::set<std::string>{"ahoj", "aha"}));
+ REQUIRE((filterByPrefix(set, "ah") == std::set<std::string>{"ahoj", "aha"}));
+ REQUIRE((filterByPrefix(set, "aho") == std::set<std::string>{"ahoj"}));
+ REQUIRE((filterByPrefix(set, "polivka") == std::set<std::string>{"polivka"}));
+ REQUIRE((filterByPrefix(set, "polivkax") == std::set<std::string>{}));
+ REQUIRE((filterByPrefix(set, "co") == std::set<std::string>{"copak", "coze"}));
}
}