Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Feb 20, 2025
1 parent 934d528 commit 4f019da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 3 additions & 10 deletions js-rattler/src/Version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,11 @@ describe("Version", () => {
});
});


describe("compare", () => {
it("should compare version with expected order", () => {
expect(
new Version("1.2.3").compare(new Version("1.2.3")),
).toBe(0);
expect(
new Version("1.2.0").compare(new Version("1.2.3")),
).toBe(-1);
expect(
new Version("1.2.4").compare(new Version("1.2.3")),
).toBe(1);
expect(new Version("1.2.3").compare(new Version("1.2.3"))).toBe(0);
expect(new Version("1.2.0").compare(new Version("1.2.3"))).toBe(-1);
expect(new Version("1.2.4").compare(new Version("1.2.3"))).toBe(1);
});
});
});
6 changes: 2 additions & 4 deletions js-rattler/src/Version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,8 @@ export class Version {

/**
* Compare 2 versions.
* Returns:
* -1 if self<other
* 0 if self == other
* 1 if self > other
*
* Returns `-1` if self<other, `0` if self == other, `1` if self > other
*/
public compare(other: Version): number {
return this.native.compare(other.native);
Expand Down

0 comments on commit 4f019da

Please sign in to comment.