You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
valactual= div(h1(), span("Some text"), "Some more of the text").toString
33
+
valexpect="""<div><h1></h1><span>Some text</span>Some more of the text</div>"""
34
+
assertEquals(expect, actual)
35
+
}
36
+
37
+
@Test
38
+
defescapeAmpersand= {
39
+
valactual= div("Some & text").toString
40
+
valexpect="""<div>Some & text</div>"""
41
+
assertEquals(expect, actual)
42
+
}
43
+
44
+
@Test
45
+
defescapeLessThan= {
46
+
valactual= div("Some < text").toString
47
+
valexpect="""<div>Some < text</div>"""
48
+
assertEquals(expect, actual)
49
+
}
50
+
51
+
@Test
52
+
defescapeGreaterThan= {
53
+
valactual= div("Some > text").toString
54
+
valexpect="""<div>Some > text</div>"""
55
+
assertEquals(expect, actual)
56
+
}
57
+
58
+
@Test
59
+
defescapeQuotationMark= {
60
+
valactual= div("Some \" text").toString
61
+
valexpect="""<div>Some " text</div>"""
62
+
assertEquals(expect, actual)
63
+
}
64
+
65
+
@Test
66
+
defescapeApostrophe= {
67
+
valactual= div("Some ' text").toString
68
+
valexpect="""<div>Some ' text</div>"""
69
+
assertEquals(expect, actual)
70
+
}
71
+
72
+
@Test
73
+
defnestedTagsWithAttributes= {
74
+
valactual= html(
75
+
head(
76
+
script(src:="..."),
77
+
script(raw("alert('Hello World')"))
78
+
),
79
+
body(
80
+
div(
81
+
h1(id:="title")("This is a title"),
82
+
p("This is a big paragraph of text")
83
+
)
84
+
)
85
+
).toString
86
+
valexpect="""<html><head><script src="..."></script><script>alert('Hello World')</script></head><body><div><h1 id="title">This is a title</h1><p>This is a big paragraph of text</p></div></body></html>"""
87
+
assertEquals(expect, actual)
88
+
}
89
+
90
+
@Test
91
+
defanotherNestedTagsWithAttributes= {
92
+
valactual= html(
93
+
head(
94
+
script("some script")
95
+
),
96
+
body(
97
+
h1(style:="background-color: blue; color: red;")("This is my title"),
valexpect="""<html><head><script>some script</script></head><body><h1 style="background-color: blue; color: red;">This is my title</h1><div style="background-color: blue; color: red;"><p class="contentpara first">This is my first paragraph</p><a style="opacity: 0.9;"><p class="contentpara">Goooogle</p></a></div></body></html>"""
0 commit comments