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.
learn_mqtt_go/main_test.go

18 lines
274 B
Go

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)
}
}