tests: add unit tests for header and template funcs

Much of this is being tested with the existing file-based tests in
testdata/*, but this moves us toward a much more targetted and simpler
test structure.
This commit is contained in:
Will Norris
2021-07-29 00:11:15 -07:00
parent ef04bb38a1
commit 366936ef00
3 changed files with 238 additions and 1 deletions

View File

@@ -334,5 +334,5 @@ func hasLicense(b []byte) bool {
}
return bytes.Contains(bytes.ToLower(b[:n]), []byte("copyright")) ||
bytes.Contains(bytes.ToLower(b[:n]), []byte("mozilla public")) ||
bytes.Contains(bytes.ToLower(b[:n]), []byte("SPDX-License-Identifier"))
bytes.Contains(bytes.ToLower(b[:n]), []byte("spdx-license-identifier"))
}