versions 3.1.0 → 3.1.0.1
raw patch · 3 files changed
+7/−1 lines, 3 files
Files
- Data/Versions.hs +3/−0
- test/Test.hs +3/−0
- versions.cabal +1/−1
Data/Versions.hs view
@@ -283,6 +283,9 @@ compare v0@(Version (Just 0) _ _) v1@(Version Nothing _ _) = compare (wipe v0) v1 compare v0@(Version Nothing _ _) v1@(Version (Just 0) _ _) = compare v0 (wipe v1) + compare (Version (Just _) _ _) (Version Nothing _ _) = GT+ compare (Version Nothing _ _) (Version (Just _) _ _) = LT+ -- | If two epochs are equal, we need to compare their actual version numbers. -- Otherwise, the comparison of the epochs is the only thing that matters. compare v0@(Version (Just n) _ _) v1@(Version (Just m) _ _) | n == m = compare (wipe v0) (wipe v1)
test/Test.hs view
@@ -72,6 +72,9 @@ , testGroup "Comparisons" $ testCase "1.2-5 < 1.2.3-1" (comp version "1.2-5" "1.2.3-1") : testCase "1.0rc1 < 1.0" (comp version "1.0rc1" "1.0") :+ testCase "1.0 < 1:1.0" (comp version "1.0" "1:1.0") :+ testCase "1.1 < 1:1.0" (comp version "1.1" "1:1.0") :+ testCase "1.1 < 1:1.1" (comp version "1.1" "1:1.1") : map (\(a,b) -> testCase (unpack $ a <> " < " <> b) $ comp version a b) (zip cabalOrd (tail cabalOrd) <> zip versionOrd (tail versionOrd)) ]
versions.cabal view
@@ -3,7 +3,7 @@ -- see: https://github.com/sol/hpack name: versions-version: 3.1.0+version: 3.1.0.1 synopsis: Types and parsers for software version numbers. description: A library for parsing and comparing software version numbers. We like to give version numbers to our software in a myriad of