Are there any databases of templates for common bioinformatic file formats? I want some templates of different file formats that I can use to test my scripts and identify possible bugs in my code.

For example, consider nucleotide FASTA, a simple but often abused format, I would want templates to capture regular and irregular formats, like I have seen all of these:

1) Single line sequence

&gt;1
ATG


2) Multi-line sequence

&gt;1
AT
G


3) Upper and lower case letters in sequence

&gt;1
Atg


4) Ns and Xs (and possibly other letters) in sequence

&gt;1
ANnxX


5) Unusual headers (sometimes non-ASCI characters, need to consider the encoding)

&gt;ATG &gt;汉字
ATG


6) Whitespace between records

&gt;1
ATG

&gt;2
ATG


7) Duplicated headers

&gt;1
ATG
&gt;1
ATC


8) Empty headers or sequences (valid FASTA?)

&gt;
&gt;


9) No new line '\n' character on last line (can mess-up file concatenation)

&gt;1
A# &lt; no new-line here


10) Different newline characters depending on the OS

&gt;1
A# \r\n vs \n


etc.

There should be separate templates for nucleotide and protein FASTA, and separate ones for aligned FASTA.

It would ideally include other aspects too, like different compression formats (such as .gz, .bzip2) and different file extensions (such as .fa, .fasta).

I have never seen resources that provide templates covering these, but I think it would be useful. Of course I could build my own templates but it would take time to capture all the likely variations of the formats, particularly for more complex file formats.

Note, I am not just interested in FASTA format, it was an example.

Also note, I know about tools (such as BioPython) that should handle many formats well, but they may also have bugs. Anyway, in practice sometimes I end up parsing files myself directly because I don't want the overhead or dependency of an external package.

EDIT: Please don't answer this question to say you don't know of any such resources, me neither, hence the question. bli's helpful answer shows that there is at least one test suite that could be used as a starting point. I know that it is normally easy to look up the specification of any particular file format.
You mention Biopython, which contains tests: https://github.com/biopython/biopython/tree/master/Tests.

Some of the tests consist in reading files present in the folders listed in the above link. These files could be a starting point for a database of test files. Whenever one comes across a test case not covered with these files, one could construct a new test file and contribute it to Biopython, along with a test, or at least file an issue: https://github.com/biopython/biopython/issues.

That would be a way to contribute to Biopython while constituting a database of test files.