Skip to content

Commit

Permalink
test: add testdata
Browse files Browse the repository at this point in the history
  • Loading branch information
ernado committed Nov 21, 2021
1 parent 61b45c5 commit 1f077fb
Show file tree
Hide file tree
Showing 6 changed files with 3,265 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ignore:
# We have only auxiliary binaries in internal/ no actual user-facing code.
- internal/**
coverage:
status:
patch: false
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@ issues:
- path: main\.go
linters: [ goconst, funlen, gocognit, gocyclo ]

# Ignore run-once generator
- path: citygen
linters: [ revive, gosec ]
24 changes: 24 additions & 0 deletions 128_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ func TestU128_Append(t *testing.T) {
}
}

func TestU128_Set(t *testing.T) {
v := U128{0x18062081bf558df, 0x63416eb68f104a36}

var got U128

b := make([]byte, 16)
v.Put(b)
got.Set(b)

if v != got {
t.Error("mismatch")
}
}

func BenchmarkU128_Append(b *testing.B) {
b.ReportAllocs()
v := U128{0x18062081bf558df, 0x63416eb68f104a36}
Expand All @@ -35,3 +49,13 @@ func BenchmarkU128_Arr(b *testing.B) {
_ = a[15]
}
}

func BenchmarkU128_Put(b *testing.B) {
b.ReportAllocs()
v := U128{0x18062081bf558df, 0x63416eb68f104a36}
buf := make([]byte, 16)

for i := 0; i < b.N; i++ {
v.Put(buf)
}
}
Loading

0 comments on commit 1f077fb

Please sign in to comment.