Added a test for Terms.WriteTo
This commit is contained in:
parent
90b6e52798
commit
b3fd1d386b
@ -178,6 +178,21 @@ func TestParentElement(t *testing.T) {
|
|||||||
properties.TestingRun(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() {
|
func Example() {
|
||||||
userInput := "<script>launchMissiles();</script>"
|
userInput := "<script>launchMissiles();</script>"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user