File: rabin_test.go

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

import (
	"testing"
)

func TestRabin(t *testing.T) {
	t.Run("int", func(t *testing.T) {
		if got, want := rabin([]byte(`"int"`)), uint64(0x7275d51a3f395c8f); got != want {
			t.Errorf("GOT: %#x; WANT: %#x", got, want)
		}
	})

	t.Run("string", func(t *testing.T) {
		if got, want := rabin([]byte(`"string"`)), uint64(0x8f014872634503c7); got != want {
			t.Errorf("GOT: %#x; WANT: %#x", got, want)
		}
	})
}