summaryrefslogtreecommitdiff
path: root/reencode_test.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-14 11:44:36 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-16 22:56:31 -0700
commitd19e2c6884c2d409fcc828c870f1839ee84f38cb (patch)
tree3a61b0c070a5db186e2c49fe70dff6f40431124e /reencode_test.go
parent6f8e7db1ac5ddd21b8e3fcc39a1e30fde9b62c3a (diff)
reencode: Factor into separate modules
Diffstat (limited to 'reencode_test.go')
-rw-r--r--reencode_test.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/reencode_test.go b/reencode_test.go
index 38f3f8f..83660ef 100644
--- a/reencode_test.go
+++ b/reencode_test.go
@@ -66,12 +66,13 @@ func TestReEncode(t *testing.T) {
"arrays2": {
enc: ReEncoderConfig{
Indent: "\t",
- CompactIfUnder: 10,
+ CompactIfUnder: 15,
ForceTrailingNewlines: true,
},
in: []any{
map[string]any{
"a": 1,
+ "b": 2,
},
map[string]any{
"generation": 123456,
@@ -81,7 +82,7 @@ func TestReEncode(t *testing.T) {
},
},
exp: `[
- {"a":1},
+ {"a":1,"b":2},
{
"generation": 123456
},
@@ -120,6 +121,16 @@ func TestReEncode(t *testing.T) {
]
`,
},
+ "indent-unicode": {
+ enc: ReEncoderConfig{
+ Prefix: "—",
+ Indent: "»",
+ },
+ in: []int{9},
+ exp: `[
+—»9
+—]`,
+ },
}
for tcName, tc := range testcases {
tc := tc