Skip to content

Commit

Permalink
1.8.16: fix stupid cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Dec 15, 2019
1 parent 7c51677 commit f350f67
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
8 changes: 1 addition & 7 deletions bump.nim
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,6 @@ proc isValid*(ver: Version): bool =
## true if the version seems legit
result = ver.major > 0'u or ver.minor > 0'u or ver.patch > 0'u

proc `>`*(a, b: Version): bool {.inline.} =
result = a.major > b.major or a.minor > b.minor or a.patch > b.patch

proc `==`*(a, b: Version): bool {.inline.} =
result = a.major == b.major and a.minor == b.minor and a.patch == b.patch

proc parseVersion*(nimble: string): Option[Version] =
## try to parse a version from any line in a .nimble;
## safe to use at compile-time
Expand Down Expand Up @@ -652,4 +646,4 @@ when isMainModule:
"release": "also use `hub` to issue a GitHub release",
"log-level": "specify Nim logging level",
"manual": "manually set the new version to #.#.#",
}
}
2 changes: 1 addition & 1 deletion bump.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "1.8.15"
version = "1.8.16"
author = "disruptek"
description = "a tiny tool to bump nimble versions"
license = "MIT"
Expand Down
3 changes: 3 additions & 0 deletions tests/tbump.nim
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ suite "bump":
test "version comparison":
check ver123 < ver155
check ver170 > ver123
check ver171 > ver170
check ver170 < ver171
check ver456 > ver170
check ver170 != (1'u, 2'u, 3'u)
check ver170 == (1'u, 7'u, 0'u)
check ver170 <= (1'u, 7'u, 0'u)
Expand Down

0 comments on commit f350f67

Please sign in to comment.