Skip to content

testFilePrefixNamesNoScript and testBytesToHexHasNoPrefix assert only what a sibling in the same file already implies #72

Description

@thedavidmeister

Audit scope: whole-repo, commit 7aa85a4

Dimension 4 (code quality) · low

Locations:

  • test/src/lib/LibCodeGen.filePrefix.t.sol:15-17
  • test/src/lib/LibHexString.bytesToHex.t.sol:74-79

Path note: PR #56 is open and unmerged as of filing. On main today these files are test/lib/LibCodeGen.filePrefix.t.sol and test/lib/LibHexString.bytesToHex.t.sol; they become test/src/lib/... after #56 merges.

Problem

testFilePrefixNamesNoScript asserts the prefix contains no .sol;
testFilePrefixExact (19-32) pins the prefix byte for byte, so nothing can fail
the first without failing the second. testBytesToHexHasNoPrefix asserts no x
in the output; testBytesToHexCharset (89-95) asserts every byte is in
[0-9a-f], which excludes x — and both spend 2048 fuzz runs. Neither test can
discriminate anything its sibling does not.

Proposed fix

Delete both bodies and fold their intent into the surviving sibling's
docstring (why no script may be named; why a surviving prefix character is
fatal).

Metadata

Metadata

Labels

auditAudit findinglowAudit findingpass4Audit finding

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions