Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-418

UrlValidatorTest: testIsValid() does not run all tests

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6
    • Component/s: None
    • Labels:
      None

      Description

      The method testIsValid() does not iterate through all possible combinations of scheme, authority, etc. Namely, the last element in testUrlScheme is skipped. This is due to a bug in incrementTestPartsIndex, which returns false (indicating the maximum set of indices has been reached) prematurely.

      Incidentally, the last test scheme currently present is the empty scheme "". This test case has been removed in the provided patch because the url string parser appears to assume that the scheme is nonempty. (e.g. if the scheme is empty, the scheme field will often be populated with the authority data).

        Attachments

        1. Validator-418-test.patch
          1 kB
          Robert McGuigan

          Activity

            People

            • Assignee:
              britter Benedikt Ritter
              Reporter:
              mcguigro Robert McGuigan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: