mirror of
https://github.com/alice-lg/alice-lg.git
synced 2024-05-11 05:55:03 +00:00
26 lines
451 B
Go
26 lines
451 B
Go
package birdwatcher
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestGetMasterPipeName(t *testing.T) {
|
|
config := Config{
|
|
PipeProtocolPrefix: "pp",
|
|
PeerTablePrefix: "pb",
|
|
}
|
|
|
|
bw := &MultiTableBirdwatcher{
|
|
GenericBirdwatcher: GenericBirdwatcher{
|
|
config: config,
|
|
},
|
|
}
|
|
|
|
peerProto := "pb_0200_as123456"
|
|
expected := "pp_0200_as123456"
|
|
if res := bw.getMasterPipeName(peerProto); res != expected {
|
|
t.Error("Expected:", peerProto, "but got:", res)
|
|
}
|
|
|
|
}
|