@@ -35,6 +35,14 @@ StdStringOverlayTestSuite.test("std::string <=> Swift.String") {
3535 expectEqual ( cxx6. size ( ) , 7 )
3636 let swift6 = String ( cxxString: cxx6)
3737 expectEqual ( swift6, " xyz \0 abc " )
38+
39+ var cxx7 = std. string ( )
40+ let bytes : [ UInt8 ] = [ 0xE1 , 0xC1 , 0xAC ]
41+ for byte in bytes {
42+ cxx7. push_back ( CChar ( bitPattern: byte) )
43+ }
44+ let swift7 = String ( cxxString: cxx7)
45+ expectEqual ( swift7, " ��� " )
3846}
3947
4048StdStringOverlayTestSuite . test ( " std::string as Swift.CustomDebugStringConvertible " ) {
@@ -71,4 +79,19 @@ StdStringOverlayTestSuite.test("std::string as Swift.Sequence") {
7179 expectEqual ( 97 + 98 + 99 + 49 + 50 + 51 , sum)
7280}
7381
82+ StdStringOverlayTestSuite . test ( " std::string as CustomStringConvertible " ) {
83+ let cxx1 = std. string ( )
84+ expectEqual ( cxx1. description, " " )
85+
86+ let cxx2 = std. string ( " something123 " )
87+ expectEqual ( cxx2. description, " something123 " )
88+
89+ let bytes : [ UInt8 ] = [ 0xE1 , 0xC1 , 0xAC ]
90+ var cxx3 = std. string ( )
91+ for byte in bytes {
92+ cxx3. push_back ( CChar ( bitPattern: byte) )
93+ }
94+ expectEqual ( cxx3. description, " ��� " )
95+ }
96+
7497runAllTests ( )
0 commit comments