Skip to content

Test docstrings name other tests and state what they cover #87

Description

@SeanTAllen

Three test docstrings describe another test's coverage.

_TestShake128XofPrefixSmall in ssl/crypto/_test.pony:

No KAT anchor — sizes below 16 are guarded by _TestShake128XofPrefix at larger sizes.

The sentence is true today. _TestShake128XofPrefix generates sizes 16 through 256 and checks each result against a 16-byte known answer, which is the anchor the docstring means. Change its generator to start at 8 and the sentence is false. Nothing fails.

_TestShake256XofPrefixSmall says the same about _TestShake256XofPrefix.

_TestTCPSSLPeerCertificateHostnameMismatch in ssl/net/_test.pony reaches for the positive test four times, twice by the name _TestTCPSSLPeerCertificateVerify and twice as "the positive test":

The pair with _TestTCPSSLPeerCertificateVerify — which would also fail under a broken chain — provides the distinguishing signal.

A comment cannot carry a fact about which tests exist and what they cover. Rename a test, narrow a generator, or delete one, and nothing rebuilds the sentence that depended on it. The coupling runs one way as well: nothing in _TestTCPSSLPeerCertificateVerify records that another test leans on it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions