Commit bf8ac8c5 authored by Rod Vagg's avatar Rod Vagg

Remove pretty-printing

parent 053176aa
......@@ -54,7 +54,7 @@ func Encode(n ipld.Node, w io.Writer) error {
// (There's not really any fastpaths of note for json.)
// Write another function if you need to tune encoding options about whitespace.
return Marshal(n, json.NewEncoder(w, json.EncodeOptions{
Line: []byte{'\n'},
Indent: []byte{'\t'},
Line: nil,
Indent: nil,
}), true)
}
......@@ -15,15 +15,7 @@ var byteNode = fluent.MustBuildMap(basicnode.Prototype__Map{}, 4, func(na fluent
na.AssembleEntry("plain").AssignString("olde string")
na.AssembleEntry("bytes").AssignBytes([]byte("deadbeef"))
})
var byteSerial = `{
"plain": "olde string",
"bytes": {
"/": {
"bytes": "ZGVhZGJlZWY="
}
}
}
`
var byteSerial = `{"plain":"olde string","bytes":{"/":{"bytes":"ZGVhZGJlZWY="}}}`
func TestRoundtripBytes(t *testing.T) {
t.Run("encoding", func(t *testing.T) {
......@@ -46,16 +38,7 @@ var encapsulatedNode = fluent.MustBuildMap(basicnode.Prototype__Map{}, 1, func(n
sa.AssembleEntry("bytes").AssignBytes([]byte("deadbeef"))
})
})
var encapsulatedSerial = `{
"/": {
"bytes": {
"/": {
"bytes": "ZGVhZGJlZWY="
}
}
}
}
`
var encapsulatedSerial = `{"/":{"bytes":{"/":{"bytes":"ZGVhZGJlZWY="}}}}`
func TestEncapsulatedBytes(t *testing.T) {
t.Run("encoding", func(t *testing.T) {
......
......@@ -27,23 +27,7 @@ var n = fluent.MustBuildMap(basicnode.Prototype__Map{}, 4, func(na fluent.MapAss
})
})
})
var serial = `{
"plain": "olde string",
"map": {
"one": 1,
"two": 2
},
"list": [
"three",
"four"
],
"nested": {
"deeper": [
"things"
]
}
}
`
var serial = `{"plain":"olde string","map":{"one":1,"two":2},"list":["three","four"],"nested":{"deeper":["things"]}}`
func TestRoundtrip(t *testing.T) {
t.Run("encoding", func(t *testing.T) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment