@@ -82,7 +82,7 @@ extension HTMLKitTests {
8282
8383extension HTMLKitTests {
8484 @Test func test_recursive( ) {
85- let string : String = #div( [
85+ let string : StaticString = #div( [
8686 #div( ) ,
8787 #div( [ #div( ) , #div( ) , #div( ) ] ) ,
8888 #div( )
@@ -130,16 +130,26 @@ extension HTMLKitTests {
130130}
131131
132132extension HTMLKitTests {
133- static let spongebob : String = " Spongebob "
134- static func spongebobCharacter( _ string: StaticString ) -> StaticString {
135- if string == " patrick " {
136- return " Patrick Star "
133+ static let spongebob : String = " Spongebob Squarepants "
134+ static let patrick : StaticString = " Patrick Star "
135+ static func spongebobCharacter( _ string: String ) -> StaticString {
136+ switch string {
137+ case " spongebob " : return " Spongebob Squarepants "
138+ case " patrick " : return " Patrick Star "
139+ default : return " Plankton "
137140 }
138- return " Plankton "
139141 }
140142
141143 @Test func test_third_party_literal( ) {
142- #expect( #div( attributes: [ . title( HTMLKitTests . spongebob) ] ) == " <div title= \" Spongebob \" ></div> " )
144+ var string : String = #div( attributes: [ . title( HTMLKitTests . spongebob) ] )
145+ #expect( string == " <div title= \" Spongebob Squarepants \" ></div> " )
146+
147+ string = #div( attributes: [ . title( HTMLKitTests . patrick) ] )
148+ #expect( string == " <div title= \" Patrick Star \" ></div> " )
149+
150+ /*let mr_crabs:StaticString = "Mr. Crabs"
151+ let static_string:StaticString = #div(attributes: [.title(mr_crabs)])
152+ #expect(static_string == "<div title=\"Mr. Crabs\"></div>")*/
143153 }
144154 @Test func test_third_party_func( ) {
145155 #expect( #div( attributes: [ . title( HTMLKitTests . spongebobCharacter ( " patrick " ) ) ] ) == " <div title= \" Patrick Star \" ></div> " )
0 commit comments