Comments (8)
Ok, I think all these are fixed on master as well.
Thank you for this heroic and excellent bug reporting!
(I'm particularly embarrassed in this case -- there were fixtures on the token side meant to cover precisely these cases... but no mappings defined on the matching the cbor side. It's to the point I should be writing tests to make sure the texts are fully filling out the
from refmt.
Thanks for the quick turn around, I have some more issues I am afraid
[]
gets turned intonil
if I round trip it{"a":"IPFS","b":null,"c":[1]}
gets turned into{"a":"IPFS","b":"IPFS","c":[1]}
in a round trip
from refmt.
It would probably be useful to add a bunch of test vectors, making sure things work as expected. Some I have used in the past and might be useful
- official cbor test vectors https://github.com/dignifiedquire/borc/blob/master/test/fixtures/vectors.js
- various vectors discovered over time: https://github.com/dignifiedquire/borc/blob/master/test/fixtures/cases.js
- fuzzing using something that generates arbitrary JSON and making sure roundtripping gives the same data: https://github.com/dignifiedquire/borc/blob/master/test/garbage.spec.js
from refmt.
Sorry E_TIME_BUDGET happened a bit... I'll try to allocate some time this evening.
At first glance, these are probably issues with nil-vs-typed-nil being handled inconsistently in the obj mapper package rather than a cbor problem. So I'll be focusing on adding unit tests and fixtures there.
Those borc tools look useful...! Maybe with a little work I can rig them around the refmt
CLI tool to get a lot of acceptance test coverage there. Though this might require some rather odd subcommands like refmt cbor=obj=cbor
, which would have very little sensible purpose other than testing.
from refmt.
Fixed the issue with nulls, thanks.
I can't reproduce your issue with []
. Am I missing something?
from refmt.
Thanks, I'll check it out. There is always the chance my code is the issue :)
from refmt.
Turns out the []
was an issue on our side thanks a lot for the work.
from refmt.
Even more test coverage is a very acceptable "problem" to have as a sideeffect :)
from refmt.
Related Issues (20)
- Things fail with weird errors if your atlas doesnt know about all your types
- cbor output is not canonical HOT 7
- Is it possible to defer unmarshaling? HOT 1
- [cbor] Unable to roundtrip map[string]*CustomStruct HOT 2
- Panics and OOMs in cbor decoding HOT 8
- Option to encode nil slice/map as []/{}
- The handling of nil byte slices is different than the handling of other types of nil slices HOT 2
- blocking parallel execution? HOT 8
- Allow pointers when using UseTag HOT 3
- [cbor] Unable to use numbers as map keys HOT 5
- Using a transform function to/from an interface cause a nil pointer dereference
- Can't round trip nil slice HOT 1
- Encoding zero values as null HOT 5
- Fails to decode a valid CBOR object HOT 2
- Remove random binaries from git repo HOT 1
- Support for arbitrary structs without explicitly registering them HOT 2
- Possible to create my own raw marshal/unmarshal? HOT 6
- Support skipping unknown fields
- No go.mod, so modern idioms for building and testing fail?
- .gitmodules has extra trailing slashes that break "git submodule update --init"
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 refmt.