It's a bug when comments contradict code. Fortunately, the code is correct.

In Drupal\system\Tests\Database\SchemaTest::testSchemaAddField(), a comment declares "Precision must be smaller than scale." because that's what the code is checking for. Of course, the opposite is true, and just reading that is confusing.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Status: Needs review » Needs work

Doh! Good catch. I don't think I am quite happy with the patch though. Really what that little block of code is doing is skipping combinations that come up in the loop, where the precision would be smaller than the scale. Can we change the comment to include the word "skip" or "skipping", rather than just saying "must be"?

Also, as a note, it should be "than" not "then".

Island Usurper’s picture

Those are good points. How about saying it like this? Part of me wants to say something like "because it's in the standards" or "because it's impossible", but that may not be necessary.

Island Usurper’s picture

Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Quick fix

Thanks! Much better.

BETA: Small docs comment fix, allowed.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Documentation is not frozen in beta. Committed f971c18 and pushed to 8.0.x. Thanks!

  • alexpott committed f971c18 on
    Issue #2449147 by Island Usurper: Backwards logic in a comment in a test
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.