forked from boyska/circolog
Fix hub tests.
This commit is contained in:
parent
aef8a277e5
commit
c5eee0ea22
1 changed files with 4 additions and 3 deletions
|
@ -3,11 +3,12 @@ package circolog
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"git.lattuga.net/boyska/circolog/data"
|
||||||
"gopkg.in/mcuadros/go-syslog.v2/format"
|
"gopkg.in/mcuadros/go-syslog.v2/format"
|
||||||
)
|
)
|
||||||
|
|
||||||
func msg(s string) format.LogParts {
|
func msg(s string) format.LogParts {
|
||||||
return format.LogParts{"text": s}
|
return format.LogParts{"content": s}
|
||||||
}
|
}
|
||||||
|
|
||||||
func hubCount(h Hub) int {
|
func hubCount(h Hub) int {
|
||||||
|
@ -19,10 +20,10 @@ var DefaultClient ClientOptions = ClientOptions{Nofollow: true, BacklogLength: -
|
||||||
func hubToArrayOpt(h Hub, opt ClientOptions) []string {
|
func hubToArrayOpt(h Hub, opt ClientOptions) []string {
|
||||||
r := make([]string, 0)
|
r := make([]string, 0)
|
||||||
cl := Client{Options: opt}
|
cl := Client{Options: opt}
|
||||||
cl.Messages = make(chan format.LogParts)
|
cl.Messages = make(chan data.Message)
|
||||||
h.Register <- cl
|
h.Register <- cl
|
||||||
for m := range cl.Messages {
|
for m := range cl.Messages {
|
||||||
r = append(r, m["text"].(string))
|
r = append(r, m["msg"].(string))
|
||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue