Added coverage checker for caplin packages (#7609)

This commit is contained in:
Giulio rebuffo 2023-05-31 18:12:18 +02:00 committed by GitHub
parent 0dc8e271a9
commit c0042d570c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 0 deletions

15
cl/coverage Normal file
View File

@ -0,0 +1,15 @@
#!/bin/bash
SKIP_TESTS=(
"github.com\/ledgerwatch\/erigon\/cl\/beacon"
"github.com\/ledgerwatch\/erigon\/cl\/phase1"
"github.com\/ledgerwatch\/erigon\/cl\/phase1\/core"
"github.com\/ledgerwatch\/erigon\/cl\/phase1\/network"
"github.com\/ledgerwatch\/erigon\/cl\/phase1\/stages"
"github.com\/ledgerwatch\/erigon\/cl\/rpc"
"github.com\/ledgerwatch\/erigon\/cl\/spectest\/consensus_tests"
)
FLAGS=$(printf " -e /%s\\\t/d" "${SKIP_TESTS[@]}")
go test ./... --cover | sed ${FLAGS}

18
cl/phase1/cache/cache_test.go vendored Normal file
View File

@ -0,0 +1,18 @@
package cache_test
import (
"testing"
"github.com/ledgerwatch/erigon/cl/cltypes/solid"
"github.com/ledgerwatch/erigon/cl/phase1/cache"
"github.com/stretchr/testify/require"
)
func TestAttestationsCache(t *testing.T) {
input := []uint64{1}
a := &solid.AttestationData{}
cache.StoreAttestation(a, []uint64{1})
output, valid := cache.LoadAttestatingIndicies(a)
require.True(t, valid)
require.Equal(t, input, output)
}