-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make tests available as JSON and as CSV (RFC 4180) #79
base: main
Are you sure you want to change the base?
Conversation
Makefile assumes that editing happens in CSV json-to-csv.rb can be called manually after an edit to the JSON
Running make gives me
I suppose there is something I should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in my local setting (*) I bump into this error:
➜ tests git:(tests-csv) make
ruby csv-to-json.rb tests.csv | diff tests.json -
csv-to-json.rb:39: syntax error, unexpected in, expecting when
in ["base", baseuri, basecri_di...
csv-to-json.rb:43: syntax error, unexpected in, expecting end
in ["ok", uri_in, cri_in_diag, ...
csv-to-json.rb:51: syntax error, unexpected end, expecting end-of-input
end
1,713d0
< {
< "base-uri": "coaps://foo:4711/pa/th?query#frag",
[...]
which I'm having a bit of trouble decoding...
(*) Darwin Kernel Version 22.5.0: Mon Apr 24 20:53:19 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6020 arm64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated ruby to 3.2, fetched 0bd3157 and now I got the same as @chrysn :
➜ tests git:(tests-csv) make
ruby csv-to-json.rb tests.csv | diff tests.json -
<internal:/opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- cbor-diagnostic (LoadError)
from <internal:/opt/homebrew/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from csv-to-json.rb:1:in `<main>'
1,713d0
Or now just:
|
Building still fails for me, but this time it seems to be other dependencies -- I'll focus on the CSV in further testing, and ignore the build process. |
Next step: cabo will push an update where everything is in its current shape. CSV will be the source of truth, JSON will stay provided for those who can't process CSV easily. |
Use diagnostic notation; supply hex CBOR only as optional additional info
"uri-from-cri": "//a%2Ea", | ||
"resolved-cri": "82218163612e61", | ||
"resolved-uri": "coaps://a%2Eb", | ||
"invalid": "The dot ('.') is unreserved, and thus never percent encoded, and thus (when used with a delimiter) not legal in the strings of the host" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this fare under the CSV-JSON conversion?
| Key Name | Description | | ||
| --- | --- | | ||
| `type` | kind of test: `ok`, `rt` (round-trip), `red` (normalized on roundtrip); special value `base` | | ||
| `uri` | a URI reference | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AIU this is optional; in cases when a CRI reference can not be expressed as a URI reference (or the test author didn't care about URIs in this scenario), it is often empty. Is this distinguished from the empty URI reference?
|
||
(Note that, with these settings, no quote character is used at all for | ||
the extant examples.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Note that, with these settings, no quote character is used at all for | |
the extant examples.) |
There is an example with …;|a;a|;…
in the latest version.
Makefile assumes that editing happens in CSV
make new-tests.csv can be called manually after an edit to the JSON