If I want to test how well JSONDecoder produces instances of DecodingError, and then how well DecodingError prints debug output, where would I do that? I see that DecodingError is defined here, so I guess I can add the conformance and add the debug output there.
What about testing that JSONDecoder produces the correct errors on failure? Are there tests somewhere that I couldn't find, or are they missing?
JSONEncoderTests.swift is a slightly deceiving name - it is a test suite for both JSONEncoder and JSONDecoder, it just happens that a lot of things that test decoding first encode the information and test decoding it, but others (like test_JSONFailTests) test just JSONDecoder. So any JSONDecoder specific tests can go into JSONEncoderTests.swift in swift-foundation.
That being said, as DecodingError is defined in the standard library I think tests for DecodingError in specific are also best put in the standard library so that'd likely be where the basic tests for DecodingError would go. The JSONDecoder tests in swift-foundation could include any JSONDecoder specific validations beyond those.