Skip to content

Commit

Permalink
fix: Fix .x version range to work correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz committed Sep 9, 2023
1 parent 4cd7c88 commit 511b6aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/antq/util/ver.clj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
(str/replace "+" "\\+")
(str/replace "?" "\\?")
;; .x
(str/replace "\\.x" "\\.+")
(str/replace "\\.x" "\\.\\d+")
;; *
(str/replace "*" ".*")
(->> (str "^"))
Expand Down
8 changes: 7 additions & 1 deletion test/antq/util/ver_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,10 @@
(t/is (true? (sut/in-range? "*" "2.0.0")))

(t/is (false? (sut/in-range? "1.0.*" "1.1.0")))
(t/is (false? (sut/in-range? "1.0*" "1.1.0")))))
(t/is (false? (sut/in-range? "1.0*" "1.1.0"))))

(t/testing "combination"
(t/is (true? (sut/in-range? "1.0.x-alpha*" "1.0.0-alpha1")))

(t/is (false? (sut/in-range? "1.0.x-alpha*" "1.0.0-bata1")))
(t/is (false? (sut/in-range? "1.0.x-alpha*" "1.1.0-alpha1")))))

0 comments on commit 511b6aa

Please sign in to comment.