diff options
Diffstat (limited to 'SCons/Tool/JavaCommonTests.py')
-rw-r--r-- | SCons/Tool/JavaCommonTests.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/SCons/Tool/JavaCommonTests.py b/SCons/Tool/JavaCommonTests.py index 75e75efd6..fa462b698 100644 --- a/SCons/Tool/JavaCommonTests.py +++ b/SCons/Tool/JavaCommonTests.py @@ -34,14 +34,14 @@ import TestSCons # the parser to spit out trace messages of the tokens it sees and the # attendant transitions. -def trace(token, newstate): +def trace(token, newstate) -> None: from SCons.Debug import Trace statename = newstate.__class__.__name__ Trace('token = %s, state = %s\n' % (repr(token), statename)) class parse_javaTestCase(unittest.TestCase): - def test_bare_bones(self): + def test_bare_bones(self) -> None: """Test a bare-bones class""" input = """\ @@ -65,7 +65,7 @@ public class Foo assert classes == ['Foo'], classes - def test_file_parser(self): + def test_file_parser(self) -> None: """Test the file parser""" input = """\ package com.sub.bar; @@ -90,7 +90,7 @@ public class Foo assert classes == ['Foo'], classes - def test_dollar_sign(self): + def test_dollar_sign(self) -> None: """Test class names with $ in them""" input = """\ @@ -104,7 +104,7 @@ public class BadDep { - def test_inner_classes(self): + def test_inner_classes(self) -> None: """Test parsing various forms of inner classes""" input = """\ @@ -227,7 +227,7 @@ class Private { - def test_comments(self): + def test_comments(self) -> None: """Test a class with comments""" input = """\ @@ -272,7 +272,7 @@ public class Example1 extends UnicastRemoteObject implements Hello { assert classes == ['Example1'], classes - def test_arrays(self): + def test_arrays(self) -> None: """Test arrays of class instances""" input = """\ @@ -292,7 +292,7 @@ public class Test { - def test_backslash(self): + def test_backslash(self) -> None: """Test backslash handling""" input = """\ @@ -310,7 +310,7 @@ public class MyTabs assert classes == ['MyTabs$MyInternal', 'MyTabs'], classes - def test_enum(self): + def test_enum(self) -> None: """Test the Java 1.5 enum keyword""" input = """\ @@ -323,7 +323,7 @@ public enum a {} assert classes == ['a'], classes - def test_anon_classes(self): + def test_anon_classes(self) -> None: """Test anonymous classes""" input = """\ @@ -347,7 +347,7 @@ public abstract class TestClass assert classes == ['TestClass$1', 'TestClass$2', 'TestClass'], classes - def test_closing_bracket(self): + def test_closing_bracket(self) -> None: """Test finding a closing bracket instead of an anonymous class""" input = """\ @@ -365,7 +365,7 @@ class Foo { } assert classes == ['TestSCons', 'Foo'], classes - def test_dot_class_attributes(self): + def test_dot_class_attributes(self) -> None: """Test handling ".class" attributes""" input = """\ @@ -398,7 +398,7 @@ public class A { assert pkg_dir is None, pkg_dir assert classes == ['A$B', 'A'], classes - def test_anonymous_classes_with_parentheses(self): + def test_anonymous_classes_with_parentheses(self) -> None: """Test finding anonymous classes marked by parentheses""" input = """\ @@ -432,7 +432,7 @@ public class Foo { - def test_nested_anonymous_inner_classes(self): + def test_nested_anonymous_inner_classes(self) -> None: """Test finding nested anonymous inner classes""" input = """\ @@ -481,7 +481,7 @@ public class NestedExample expect = [ 'NestedExample$1', 'NestedExample$1$1', 'NestedExample' ] assert expect == classes, (expect, classes) - def test_lambda_after_new(self): + def test_lambda_after_new(self) -> None: """Test lamdas after new""" input = """\ @@ -518,7 +518,7 @@ public class LamdaExample expect = [ 'LamdaExample' ] assert expect == classes, (expect, classes) - def test_private_inner_class_instantiation(self): + def test_private_inner_class_instantiation(self) -> None: """Test anonymous inner class generated by private instantiation""" input = """\ @@ -551,7 +551,7 @@ class test pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.5') assert expect == classes, (expect, classes) - def test_floating_point_numbers(self): + def test_floating_point_numbers(self) -> None: """Test floating-point numbers in the input stream""" input = """ // Broken.java @@ -592,7 +592,7 @@ class Broken assert expect == classes, (expect, classes) - def test_genercis(self): + def test_genercis(self) -> None: """Test that generics don't interfere with detecting anonymous classes""" input = """\ @@ -624,7 +624,7 @@ public class Foo assert expect == classes, (expect, classes) - def test_in_function_class_declaration(self): + def test_in_function_class_declaration(self) -> None: """ Test that implementing a class in a function call doesn't confuse SCons. """ @@ -667,7 +667,7 @@ public class AnonDemo { pkg_dir, classes = SCons.Tool.JavaCommon.parse_java(input, '1.8') assert expect == classes, (expect, classes) - def test_jdk_globs(self): + def test_jdk_globs(self) -> None: """ Verify that the java path globs work with specific examples. :return: |