Skip to content

Commit

Permalink
Fix equality comparison of identical versions with different meta data.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-ludwig committed Mar 15, 2015
1 parent 8cde5c9 commit d25f784
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/dub/dependency.d
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ struct Version {
if (isUnknown || oth.isUnknown) {
throw new Exception("Can't compare unknown versions! (this: %s, other: %s)".format(this, oth));
}
return m_version == oth.m_version;
return opCmp(oth) == 0;
}

/// Returns true, if this version indicates a branch, which is not the trunk.
Expand Down Expand Up @@ -597,4 +597,6 @@ unittest {
a = Version.UNKNOWN;
b = Version.UNKNOWN;
assertThrown(a == b, "Failed: UNKNOWN == UNKNOWN");

assert(Version("1.0.0+a") == Version("1.0.0+b"));
}

0 comments on commit d25f784

Please sign in to comment.