| Index: mojo/tools/mopy/gtest_list_tests_unittest.py
|
| diff --git a/mojo/tools/mopy/gtest_list_tests_unittest.py b/mojo/tools/mopy/gtest_list_tests_unittest.py
|
| index 917c6f9c7d30059dcdd5be55925592d6117e2784..44dc276d52a50d3de5dbc40b585a34e6d6fffc0f 100644
|
| --- a/mojo/tools/mopy/gtest_list_tests_unittest.py
|
| +++ b/mojo/tools/mopy/gtest_list_tests_unittest.py
|
| @@ -11,14 +11,8 @@ class GTestListTestsTest(unittest.TestCase):
|
|
|
| def testSingleSuiteAndFixture(self):
|
| """Tests a single suite with a single fixture."""
|
| - gtest_output = "TestSuite.\n TestFixture1"
|
| - expected_test_list = ["TestSuite.TestFixture1"]
|
| - self.assertEquals(gtest_list_tests(gtest_output), expected_test_list)
|
| -
|
| - def testExtraBlankLinesAndSpaces(self):
|
| - """Tests handling of extra blank lines and extra spaces before fixtures."""
|
| - gtest_output = "TestSuite.\n\n TestFixture1\n\n"
|
| - expected_test_list = ["TestSuite.TestFixture1"]
|
| + gtest_output = "TestSuite.\n TestFixture\n"
|
| + expected_test_list = ["TestSuite.TestFixture"]
|
| self.assertEquals(gtest_list_tests(gtest_output), expected_test_list)
|
|
|
| def testWindowsNewlines(self):
|
| @@ -29,7 +23,7 @@ class GTestListTestsTest(unittest.TestCase):
|
|
|
| def testSingleSuiteAndMultipleFixtures(self):
|
| """Tests a single suite with multiple fixtures."""
|
| - gtest_output = "TestSuite.\n TestFixture1\n TestFixture2"
|
| + gtest_output = "TestSuite.\n TestFixture1\n TestFixture2\n"
|
| expected_test_list = ["TestSuite.TestFixture1", "TestSuite.TestFixture2"]
|
| self.assertEquals(gtest_list_tests(gtest_output), expected_test_list)
|
|
|
| @@ -41,5 +35,15 @@ class GTestListTestsTest(unittest.TestCase):
|
| "TestSuite2.TestFixtureA", "TestSuite2.TestFixtureB"]
|
| self.assertEquals(gtest_list_tests(gtest_output), expected_test_list)
|
|
|
| + def testUnrecognizedFormats(self):
|
| + """Tests examples of unrecognized --gtest_list_tests output."""
|
| + self.assertRaises(Exception, gtest_list_tests, "Foo")
|
| + self.assertRaises(Exception, gtest_list_tests, "Foo\n")
|
| + self.assertRaises(Exception, gtest_list_tests, "Foo.Bar\n")
|
| + self.assertRaises(Exception, gtest_list_tests, "Foo.\nBar\n")
|
| + self.assertRaises(Exception, gtest_list_tests, "Foo.\r\nBar\r\nGaz\r\n")
|
| + self.assertRaises(Exception, gtest_list_tests, "Foo.\nBar.\n Gaz\n")
|
| +
|
| +
|
| if __name__ == "__main__":
|
| unittest.main()
|
|
|