예제 #1
0
    def test_invalid_clang_version(self):
        clang_version_type = types.ClangVersionType()

        with self.assertRaises(ArgumentTypeError):
            clang_version_type('2')
            clang_version_type('3.0')
            clang_version_type('1.8.0.2')
            clang_version_type('100.0.56.1')
예제 #2
0
    def test_valid_clang_version(self):
        clang_version_type = types.ClangVersionType()

        version = clang_version_type('1.0.0')
        self.assertIsInstance(version, types.Version)
        self.assertEqual(version.components, (1, 0, 0))

        version = clang_version_type('1.0.0.1')
        self.assertIsInstance(version, types.Version)
        self.assertEqual(version.components, (1, 0, 0, 1))

        clang_version_type('1.0.0')
        clang_version_type('3.0.2.1')
        clang_version_type('200.0.56.3')
        clang_version_type('100000.0.0.1')