From b3fd1d386bd0166e5293f921f06a3c91b713f69e Mon Sep 17 00:00:00 2001 From: Brandon Dyck Date: Sun, 28 Apr 2019 17:05:24 -0600 Subject: [PATCH] Added a test for Terms.WriteTo --- hatmill_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hatmill_test.go b/hatmill_test.go index 15b4805..3475929 100644 --- a/hatmill_test.go +++ b/hatmill_test.go @@ -178,6 +178,21 @@ func TestParentElement(t *testing.T) { properties.TestingRun(t) } +func TestTerms(t *testing.T) { + properties := gopter.NewProperties(nil) + + properties.Property("WriteTo writes the concatenation of calling WriteTo on the slice contents", prop.ForAll( + func(terms []hatmill.Term) bool { + var expected string + for _, term := range terms { + expected += string(term.(hatmill.Text)) + } + return checkWrite(hatmill.Terms(terms), expected) + }, + gen.SliceOf(htmlTextGen), + )) +} + func Example() { userInput := ""