You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
)
|
|
|
|
func TestPrintMessage(t *testing.T) {
|
|
buffer := bytes.Buffer{}
|
|
printMessage(&buffer, "Hello MQTT\n")
|
|
got := buffer.String()
|
|
want := "Hello MQTT\n"
|
|
|
|
if got != want {
|
|
t.Errorf("Error. Got %s but wanted %s", got, want)
|
|
}
|
|
}
|