mirror of
https://github.com/vacp2p/go-multiprotocol.git
synced 2026-01-09 20:47:54 -05:00
23 lines
442 B
Go
23 lines
442 B
Go
package multiprotocol
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestInit(t *testing.T) {
|
|
|
|
// empty
|
|
Protocols = make([]Protocol, 0)
|
|
protocolsByCode = make(map[int]Protocol)
|
|
protocolsByName = make(map[string]Protocol)
|
|
|
|
err := Init("testdata/multiprotocol.csv")
|
|
if err != nil {
|
|
t.Errorf("unexpected failure: %s", err.Error())
|
|
}
|
|
|
|
if len(Protocols) != 4 {
|
|
t.Errorf("unexpected amount of protocols parsed. expected: 4 got: %d", len(Protocols))
|
|
}
|
|
}
|