1 module UnitTests
.Distribution
.Simple
.Program
.Internal
5 import Distribution
.Simple
.Program
.Internal
( stripExtractVersion
)
8 import Test
.Tasty
.HUnit
11 v
= "GNU strip (GNU Binutils; openSUSE 13.2) 2.24.0.20140403-6.1\nCopyright 2013\
12 \ Free Software Foundation, Inc.\nThis program is free software; you may\
13 \ redistribute it under the terms of\nthe GNU General Public License version 3\
14 \ or (at your option) any later version.\nThis program has absolutely no\
18 v
' = "GNU strip 2.17.50.0.6-26.el5 20061020"
21 v
'' = "GNU strip (openSUSE-13.2) 2.23.50.0.6-26.el5 20061020"
24 v
''' = "GNU strip (GNU (Binutils for) Ubuntu 12.04 ) 2.22"
28 [ testCase
"Handles parentheses" $
29 (stripExtractVersion v
) @=?
"2.24"
30 , testCase
"Handles dashes and alphabetic characters" $
31 (stripExtractVersion v
') @=?
"2.17"
32 , testCase
"Handles single-word parenthetical expressions" $
33 (stripExtractVersion v
'') @=?
"2.23"
34 , testCase
"Handles nested parentheses" $
35 (stripExtractVersion v
''') @=?
"2.22"