mirror of
https://github.com/NixOS/nix.git
synced 2025-11-24 03:09:35 +01:00
Remove std::string alias (for real this time)
Also use std::string_view in a few more places.
This commit is contained in:
parent
14b38d0887
commit
df552ff53e
110 changed files with 773 additions and 681 deletions
|
|
@ -5,9 +5,9 @@ namespace nix {
|
|||
|
||||
/* ----------- tests for url.hh --------------------------------------------------*/
|
||||
|
||||
string print_map(std::map<string, string> m) {
|
||||
std::map<string, string>::iterator it;
|
||||
string s = "{ ";
|
||||
std::string print_map(std::map<std::string, std::string> m) {
|
||||
std::map<std::string, std::string>::iterator it;
|
||||
std::string s = "{ ";
|
||||
for (it = m.begin(); it != m.end(); ++it) {
|
||||
s += "{ ";
|
||||
s += it->first;
|
||||
|
|
@ -262,21 +262,21 @@ namespace nix {
|
|||
* --------------------------------------------------------------------------*/
|
||||
|
||||
TEST(percentDecode, decodesUrlEncodedString) {
|
||||
string s = "==@==";
|
||||
string d = percentDecode("%3D%3D%40%3D%3D");
|
||||
std::string s = "==@==";
|
||||
std::string d = percentDecode("%3D%3D%40%3D%3D");
|
||||
ASSERT_EQ(d, s);
|
||||
}
|
||||
|
||||
TEST(percentDecode, multipleDecodesAreIdempotent) {
|
||||
string once = percentDecode("%3D%3D%40%3D%3D");
|
||||
string twice = percentDecode(once);
|
||||
std::string once = percentDecode("%3D%3D%40%3D%3D");
|
||||
std::string twice = percentDecode(once);
|
||||
|
||||
ASSERT_EQ(once, twice);
|
||||
}
|
||||
|
||||
TEST(percentDecode, trailingPercent) {
|
||||
string s = "==@==%";
|
||||
string d = percentDecode("%3D%3D%40%3D%3D%25");
|
||||
std::string s = "==@==%";
|
||||
std::string d = percentDecode("%3D%3D%40%3D%3D%25");
|
||||
|
||||
ASSERT_EQ(d, s);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue