-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathneatjson_test.go
56 lines (46 loc) · 993 Bytes
/
neatjson_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package neatjson
import (
"testing"
"github.com/stretchr/testify/require"
)
type exampleType struct {
A string `json:"a"`
N int `json:"n"`
}
var caseExample = exampleType{
A: "abc",
N: 123,
}
func TestNeatjson_Bytes(t *testing.T) {
res, err := SP2.Bytes(caseExample)
require.NoError(t, err)
t.Log(string(res))
}
func TestNeatjson_Sjson(t *testing.T) {
res, err := TAB.Sjson(caseExample)
require.NoError(t, err)
t.Log(res)
}
func TestNeatjson_NOI_Sjson(t *testing.T) {
res, err := NOI.Sjson(caseExample)
require.NoError(t, err)
t.Log(res)
}
func TestNeatjson_SxS(t *testing.T) {
arg := `{"a": "abc","n": 123}`
res, err := SP4.SxS(arg)
require.NoError(t, err)
t.Log(res)
}
func TestNeatjson_NON_SxS(t *testing.T) {
arg := `{"a": "abc","n": 123}`
res, err := NON.SxS(arg)
require.NoError(t, err)
t.Log(res)
}
func TestNeatjson_BxB(t *testing.T) {
arg := []byte(`{"a": "abc","n": 123}`)
res, err := SP1.BxB(arg)
require.NoError(t, err)
t.Log(string(res))
}