aboutsummaryrefslogtreecommitdiff
path: root/tests/repository-location
diff options
context:
space:
mode:
Diffstat (limited to 'tests/repository-location')
-rw-r--r--tests/repository-location/buildfile1
-rw-r--r--tests/repository-location/driver.cxx32
2 files changed, 25 insertions, 8 deletions
diff --git a/tests/repository-location/buildfile b/tests/repository-location/buildfile
index c9f072f..942d723 100644
--- a/tests/repository-location/buildfile
+++ b/tests/repository-location/buildfile
@@ -1,5 +1,4 @@
# file : tests/repository-location/buildfile
-# copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
import libs = libbutl%lib{butl}
diff --git a/tests/repository-location/driver.cxx b/tests/repository-location/driver.cxx
index 6ad0bcf..4a4bbe4 100644
--- a/tests/repository-location/driver.cxx
+++ b/tests/repository-location/driver.cxx
@@ -1,18 +1,19 @@
// file : tests/repository-location/driver.cxx -*- C++ -*-
-// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
// license : MIT; see accompanying LICENSE file
#include <string>
-#include <cassert>
#include <sstream>
#include <iostream>
#include <stdexcept> // invalid_argument, logic_error
-#include <libbutl/optional.mxx>
-#include <libbutl/manifest-parser.mxx>
+#include <libbutl/optional.hxx>
+#include <libbutl/manifest-parser.hxx>
#include <libbpkg/manifest.hxx>
+#undef NDEBUG
+#include <cassert>
+
using namespace std;
using namespace butl;
@@ -563,6 +564,11 @@ namespace bpkg
assert (l.canonical_name () == "pkg:cppget.org/qw/a/b");
}
{
+ repository_location l (loc ("http://00.00.010.0/qw/1/a/b/"));
+ assert (l.string () == "http://0.0.10.0/qw/1/a/b");
+ assert (l.canonical_name () == "pkg:0.0.10.0/qw/a/b");
+ }
+ {
repository_location l (loc ("http://pkg.CPPget.org/qw/1/a/b/"));
assert (l.string () == "http://pkg.cppget.org/qw/1/a/b");
assert (l.canonical_name () == "pkg:cppget.org/qw/a/b");
@@ -761,6 +767,18 @@ namespace bpkg
assert (l1.string () == l2.string ());
assert (l1.canonical_name () == l2.canonical_name ());
}
+ {
+ repository_location l1 (loc ("c:/var/pkg/1/misc"));
+ repository_location l2 (loc ("c:/var/Pkg/1/Misc"));
+ assert (l1.canonical_name () == "pkg:misc");
+ assert (l2.canonical_name () == l1.canonical_name ());
+ }
+ {
+ repository_location l1 (loc ("c:\\repo.git", repository_type::git));
+ repository_location l2 (loc ("C:/Repo.Git", repository_type::git));
+ assert (l1.canonical_name () == "git:c:\\repo");
+ assert (l2.canonical_name () == l1.canonical_name ());
+ }
#endif
{
repository_location l1 (loc ("http://www.cppget.org/1/stable"));
@@ -884,10 +902,10 @@ namespace bpkg
assert (git_ref_filter (n) == git_ref_filter (n, nullopt, false));
assert (git_ref_filter ('+' + n) == git_ref_filter (n, nullopt, false));
assert (git_ref_filter ('-' + n) == git_ref_filter (n, nullopt, true));
- assert (git_ref_filter (c + "@") == git_ref_filter (c, nullopt, false));
+ assert (git_ref_filter (c + '@') == git_ref_filter (c, nullopt, false));
assert (git_ref_filter (c) == git_ref_filter (nullopt, c, false));
- assert (git_ref_filter ("@" + c) == git_ref_filter (nullopt, c, false));
- assert (git_ref_filter (n + "@" + c) == git_ref_filter (n, c, false));
+ assert (git_ref_filter ('@' + c) == git_ref_filter (nullopt, c, false));
+ assert (git_ref_filter (n + '@' + c) == git_ref_filter (n, c, false));
assert (parse_git_ref_filters (nullopt) ==
git_ref_filters {git_ref_filter ()});