aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/libutil/url-name.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/libutil/url-name.cc')
-rw-r--r--tests/unit/libutil/url-name.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/unit/libutil/url-name.cc b/tests/unit/libutil/url-name.cc
index f637efa89..164bb26d7 100644
--- a/tests/unit/libutil/url-name.cc
+++ b/tests/unit/libutil/url-name.cc
@@ -5,11 +5,13 @@ namespace nix {
/* ----------- tests for url-name.hh --------------------------------------------------*/
- TEST(getNameFromURL, getsNameFromURL) {
+ TEST(getNameFromURL, getNameFromURL) {
ASSERT_EQ(getNameFromURL(parseURL("path:/home/user/project")), "project");
ASSERT_EQ(getNameFromURL(parseURL("path:~/repos/nixpkgs#packages.x86_64-linux.hello")), "hello");
- ASSERT_EQ(getNameFromURL(parseURL("path:.#nonStandardAttr.mylaptop")), "nonStandardAttr.mylaptop");
- ASSERT_EQ(getNameFromURL(parseURL("path:./repos/myflake#nonStandardAttr.mylaptop")), "nonStandardAttr.mylaptop");
+ ASSERT_EQ(getNameFromURL(parseURL("path:~/repos/nixpkgs#legacyPackages.x86_64-linux.hello")), "hello");
+ ASSERT_EQ(getNameFromURL(parseURL("path:~/repos/nixpkgs#packages.x86_64-linux.Hello")), "Hello");
+ ASSERT_EQ(getNameFromURL(parseURL("path:.#nonStandardAttr.mylaptop")), "mylaptop");
+ ASSERT_EQ(getNameFromURL(parseURL("path:./repos/myflake#nonStandardAttr.mylaptop")), "mylaptop");
ASSERT_EQ(getNameFromURL(parseURL("path:./nixpkgs#packages.x86_64-linux.complex^bin,man")), "complex");
ASSERT_EQ(getNameFromURL(parseURL("path:./myproj#packages.x86_64-linux.default^*")), "myproj");