File: decoder_medium_test.go

package info (click to toggle)
golang-github-francoispqt-gojay 1.2.13-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 1,456 kB
  • sloc: makefile: 86
file content (18 lines) | stat: -rw-r--r-- 664 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package benchmarks

import (
	"testing"

	"github.com/francoispqt/gojay"
	"github.com/francoispqt/gojay/benchmarks"
	"github.com/stretchr/testify/assert"
)

func TestGoJayDecodeObjMedium(t *testing.T) {
	result := benchmarks.MediumPayload{}
	err := gojay.Unmarshal(benchmarks.MediumFixture, &result)
	assert.Nil(t, err, "err should be nil")
	assert.Equal(t, "Leonid Bugaev", result.Person.Name.FullName, "result.Person.Name.FullName should be Leonid Bugaev")
	assert.Equal(t, 95, result.Person.Github.Followers, "result.Person.Github.Followers should be 95")
	assert.Len(t, result.Person.Gravatar.Avatars, 1, "result.Person.Gravatar.Avatars should have 1 item")
}