Parsers get tested against valid input and shipped. Then a truncated upload arrives, or a JSON body with a duplicate key, and the error message is a stack trace. Each case here is annotated with what is wrong so you can check the message you produce matches.
What you can control
- Seven formats, each with six fault types applied to it.
- Truncated cases simulate an interrupted upload — the most common real-world corruption.
- Duplicate keys are valid JSON syntax with undefined behaviour, and parsers genuinely disagree about them.
- Each case is labelled with its fault so a failing test names the actual problem.
Testing ideas
- Import errors. Feed truncated and syntactically broken files to your importer and check that it reports the line and reason instead of crashing.
- Wrong types. Strings where numbers belong test schema validation messages.
- Duplicate keys. JSON parsers disagree on which duplicate wins; find out which one yours keeps.
- Oversized values. Test request-size limits and database column overflow.
What this is not
These break parsers, which is the point. Do not feed them into a production pipeline unless you are deliberately testing its error handling in an environment you can reset.