Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-7717

StaticTypeCheckingTestCase#shouldFailWithMessages erroneously passes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.5
    • Fix Version/s: 2.4.6
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      When StaticTypeCheckingTestCase#shouldFailWithMessages(String, String...) is called with multiple message arguments, the call returns successfully if both of the following are true:

      1) at least one argument is contained in a collected error message
      2) the number of message arguments equals the number of collected errors

      This causes tests to erroneously pass, even if they don't result in all of the desired errors. For example, TypeCheckingExtensionsTest#testPrecompiledExtensionNotExtendingTypeCheckingDSL currently passes even though PrecompiledExtensionNotExtendingTypeCheckingDSL#onMethodSelection throws a MissingPropertyException (which is converted to a compilation error in CompilationUnit#applyToPrimaryClassNodes) instead of actually adding the intended static type error.

        Attachments

          Activity

            People

            • Assignee:
              shils Shil Sinha
              Reporter:
              shils Shil Sinha
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: