def test_get_current_version_multiline_project_combined_token(self): under_test = CMakeVersionParser( "project\n(\nDESCRIPTION something VERSION 2.3.4 LANGUAGES c\n)") self.assertEqual(under_test.get_current_version(), '2.3.4')
def test_not_confuse_version_outside_project(self): under_test = CMakeVersionParser( "non_project(VERSION 2.3.5)\nproject(VERSION 2.3.4)") self.assertEqual(under_test.get_current_version(), '2.3.4')
def test_get_current_version_multiline_project(self): under_test = CMakeVersionParser("project\n(\nVERSION\n\t 2.3.4)") self.assertEqual(under_test.get_current_version(), '2.3.4')
def test_get_current_version_single_line_project(self): under_test = CMakeVersionParser("project(VERSION 2.3.4)") self.assertEqual(under_test.get_current_version(), '2.3.4')