yaml / yaml-test-suite

Comprehensive, language independent Test Suite for YAML
MIT License
172 stars 58 forks source link

Error cases with messages #63

Open am11 opened 4 years ago

am11 commented 4 years ago

The spec tests covering the error cases are currently exercised as:

A next level of improvement could be if the reason of error is spelled out in terms of explicit error messages. Some benefits are:

Current spec test runners will continue to work with binary logic, by checking the existence of error tag (as happening today). Some implementations may chose to align error messages exactly as the spec test describes it for hardening.

For the existing (73) error cases, error messages could be proofread and included in spec test, after collected from certain implementation like libyaml; including the location of error but without the stacktrace e.g.:

Failed to parse YAML. mapping values are not allowed in this context.
  in /path/to/file.yaml, line: 2, column: 8