summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-06-11 12:44:21 +0200
committeralalazo <massimiliano.culpo@googlemail.com>2016-06-11 12:44:21 +0200
commiteb9b00b210b3c58dc1ea4fdf2b59cd1922266561 (patch)
treecb06b88548b55a66b368b8b4f9a7841ed13d52c0 /lib
parent564483936f32abfd5ee79dea6263af4bd6e9bb9d (diff)
downloadspack-eb9b00b210b3c58dc1ea4fdf2b59cd1922266561.tar.gz
spack-eb9b00b210b3c58dc1ea4fdf2b59cd1922266561.tar.bz2
spack-eb9b00b210b3c58dc1ea4fdf2b59cd1922266561.tar.xz
spack-eb9b00b210b3c58dc1ea4fdf2b59cd1922266561.zip
versions : added unit tests for the new properties
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/test/versions.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/spack/spack/test/versions.py b/lib/spack/spack/test/versions.py
index a026403e2e..892073feab 100644
--- a/lib/spack/spack/test/versions.py
+++ b/lib/spack/spack/test/versions.py
@@ -423,3 +423,11 @@ class VersionsTest(unittest.TestCase):
self.assert_satisfies('4.8.0', '4.2, 4.3:4.8')
self.assert_satisfies('4.8.2', '4.2, 4.3:4.8')
+
+ def test_formatted_strings(self):
+ versions = '1.2.3', '1_2_3', '1-2-3'
+ for item in versions:
+ v = Version(item)
+ self.assertEqual(v.dotted, '1.2.3')
+ self.assertEqual(v.dashed, '1-2-3')
+ self.assertEqual(v.underscored, '1_2_3') \ No newline at end of file