Comments (3)
As I mentioned in the #20 review, in-json was not meant to be a raw expected result string (that would be called out-json), but rather a loaded JSON input that would be compared either in memory or by a reserialization into any mature/trusted format.
That said, I support the change if it helps people use the data in other useful ways and does not break any existing testing.
from yaml-test-suite.
- Why should this change break any existing testing? I will let the test matrix run before merging it to master
- if we generate in.json half-automatically, a canonical format will guarantee that we only get diffs for real changes
from yaml-test-suite.
With the changes brought in by PR #20, the in.json
files representing streams with multiple documents can no longer be easily parsed in a JS environment. In fact jq
might be one of the only tools that can parse their format without complaint.
As is, the files are pretty close to line-delimited JSON, for which tools do exist. Therefore, would it be possible to add a step that would use something like jq -c
in their generation?
I encountered this problem while updating the tests of my JS YAML library, which can in fact read the in.json
format, but complains about it:
import fs from 'fs'
import YAML from 'yaml'
const src = fs.readFileSync('./U9NS/in.json', 'utf8')
const doc = YAML.parseDocuments(src)[0]
doc.errors
// [ [YAMLSyntaxError: Document is not valid YAML (bad indentation?)] ]
doc.contents[0].toJSON()
// { time: '20:03:20',
// player: 'Sammy Sosa',
// action: 'strike (miss)' }
doc.contents[1].toJSON()
// { time: '20:03:47',
// player: 'Sammy Sosa',
// action: 'grand slam' }
from yaml-test-suite.
Related Issues (20)
- Individual tags per subtest don't work
- 8G76: an empty file is not a valid JSON document HOT 7
- Should L24T/01/in.yaml and JEF9/02/in.yaml end with \n? HOT 2
- is there some logic to the naming of tests? HOT 2
- Explain Token stream notation, Event stream notation HOT 1
- Create a use case for trailing TAB
- norway problem HOT 1
- Is there an error in 4H7K HOT 1
- Why is `a: :a` valid while `a: a:` is not?
- Fix generated test in Y79Y
- Scala-yaml uses this test suite HOT 1
- json for 4ABK HOT 1
- Missing tests for spec sections 5.13 and 5.14 (Escaped Characters) HOT 2
- 4FJ6 events HOT 2
- Convert all numeric mapping keys to strings HOT 3
- test/tags/directive/NTY5.tml is broken HOT 2
- Test to cover "Value after document-start" (on first line)
- Licensing HOT 1
- Add test for e.g. `[[], :@]` HOT 1
- Address #40 and #54
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yaml-test-suite.