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.
moon/lib/doc_test.go

24 lines
353 B
Go

package moon
import (
"testing"
)
func TestDoc(t *testing.T) {
doc, err := ReadString(`
name: "jordan"
`)
if err != nil {
t.Error(err)
return
}
var name string
if err := doc.Get("name", &name); err != nil {
t.Error(err)
return
}
if name != "jordan" {
t.Errorf("unexpected name value, expected 'jordan', saw '%s'", name)
}
}