mirror of
https://github.com/badaix/snapcast.git
synced 2025-06-08 22:01:44 +02:00
Fix config password parsing
This commit is contained in:
parent
7d7ef5bf10
commit
aa3b289b47
4 changed files with 52 additions and 4 deletions
|
@ -84,6 +84,23 @@ TEST_CASE("String utils")
|
|||
|
||||
std::vector<std::string> vec{"1", "2", "3"};
|
||||
REQUIRE(container_to_string(vec) == "1, 2, 3");
|
||||
|
||||
std::string right;
|
||||
std::string left = split_left("left:mid:right", ':', right);
|
||||
REQUIRE(left == "left");
|
||||
REQUIRE(right == "mid:right");
|
||||
|
||||
left = split_right("left:mid:right", ':', right);
|
||||
REQUIRE(left == "left:mid");
|
||||
REQUIRE(right == "right");
|
||||
|
||||
std::string user = split_left("username:password:with:colons:role", ':', right);
|
||||
REQUIRE(user == "username");
|
||||
REQUIRE(right == "password:with:colons:role");
|
||||
std::string role;
|
||||
std::string password = split_right(right, ':', role);
|
||||
REQUIRE(password == "password:with:colons");
|
||||
REQUIRE(role == "role");
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue