Skip to content

Commit 97a03f9

Browse files
authored
Merge pull request #103 from compnerd/array
Tests: change the conversion for string to array
2 parents 0a7e8e1 + 18c5f7a commit 97a03f9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Tests/SystemTests/SystemStringTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ private func makeRaw(
2323
_ str: String
2424
) -> [CInterop.PlatformChar] {
2525
var str = str
26+
#if os(Windows)
27+
var array = Array(str.utf16)
28+
#else
2629
var array = str.withUTF8 { $0.withMemoryRebound(to: CChar.self, Array.init) }
30+
#endif
2731
array.append(0)
2832
return array
2933
}

0 commit comments

Comments
 (0)