CheckUnparsable parses both a private-form descriptor and its corresponding public-form descriptor. The helper previously reused one error string for both parses.
The public parse therefore overwrote the private parse’s error. Although the helper verified that both parses failed, its exact error assertion only checked the error produced by the public parse. An incorrect private-form error could consequently go undetected.
Changes
- Store the private and public parse errors separately.
- Check the exact private error when a private-form descriptor is provided.
- Continue checking the exact public error.
- Add an overload that accepts different expected private and public errors.
- Preserve the existing three-argument interface for cases where both errors should match.
- Update the affected test cases with their existing private-form errors.
This also corrects a raw descriptor test whose private input used raw(...) while its public input mistakenly used sh(...). Both inputs now use raw(...), with Raw script is not hex as the expected error.
This PR only changes test code and does not affect production descriptor parsing.