mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 20:16:03 +01:00
lib{store,flake}-tests: Add test for spaces in URIs
These cases do not seem to be covered by the test suite at all.
This commit is contained in:
parent
b8d223a210
commit
ffc9bfb66d
3 changed files with 22 additions and 0 deletions
|
|
@ -48,6 +48,13 @@ TEST(parseFlakeRef, path)
|
|||
ASSERT_EQ(flakeref.to_string(), "path:/foo/bar?revCount=123");
|
||||
ASSERT_EQ(fragment, "bla");
|
||||
}
|
||||
|
||||
{
|
||||
auto s = "/foo bar/baz?dir=bla space";
|
||||
auto flakeref = parseFlakeRef(fetchSettings, s);
|
||||
ASSERT_EQ(flakeref.to_string(), "path:/foo%20bar/baz?dir=bla%20space");
|
||||
ASSERT_EQ(flakeref.toAttrs().at("dir"), fetchers::Attr("bla space"));
|
||||
}
|
||||
}
|
||||
|
||||
TEST(to_string, doesntReencodeUrl)
|
||||
|
|
|
|||
1
src/libstore-tests/data/store-reference/local_3.txt
Normal file
1
src/libstore-tests/data/store-reference/local_3.txt
Normal file
|
|
@ -0,0 +1 @@
|
|||
local://?root=/foo bar/baz
|
||||
|
|
@ -85,10 +85,24 @@ static StoreReference localExample_2{
|
|||
},
|
||||
};
|
||||
|
||||
static StoreReference localExample_3{
|
||||
.variant =
|
||||
StoreReference::Specified{
|
||||
.scheme = "local",
|
||||
},
|
||||
.params =
|
||||
{
|
||||
{"root", "/foo bar/baz"},
|
||||
},
|
||||
};
|
||||
|
||||
URI_TEST(local_1, localExample_1)
|
||||
|
||||
URI_TEST(local_2, localExample_2)
|
||||
|
||||
/* Test path with spaces */
|
||||
URI_TEST(local_3, localExample_3)
|
||||
|
||||
URI_TEST_READ(local_shorthand_1, localExample_1)
|
||||
|
||||
URI_TEST_READ(local_shorthand_2, localExample_2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue