diff --git a/source/dub/dependency.d b/source/dub/dependency.d index 27288ba..1967c32 100644 --- a/source/dub/dependency.d +++ b/source/dub/dependency.d @@ -427,6 +427,7 @@ This is true in particular for the `any` constant. */ + deprecated("Use `VersionRange.matchesAny` directly") bool matchesAny() const scope @safe { return this.m_value.match!( (Repository v) => true, @@ -435,13 +436,6 @@ ); } - unittest { - assert(Dependency("*").matchesAny); - assert(!Dependency(">0.0.0").matchesAny); - assert(!Dependency(">=1.0.0").matchesAny); - assert(!Dependency("<1.0.0").matchesAny); - } - /** Tests if the specification matches a specific version. */ bool matches(string vers, VersionMatchMode mode = VersionMatchMode.standard) const @safe @@ -962,6 +956,13 @@ && this.m_versB == Version.maxRelease; } + unittest { + assert(VersionRange.fromString("*").matchesAny); + assert(!VersionRange.fromString(">0.0.0").matchesAny); + assert(!VersionRange.fromString(">=1.0.0").matchesAny); + assert(!VersionRange.fromString("<1.0.0").matchesAny); + } + public static VersionRange fromString (string ves) @safe { static import std.string;