Skip to content

Commit 6292835

Browse files
committed
cleanup assert output for wrap-java to be not whitespace sensitive
1 parent 2abc1d9 commit 6292835

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Tests/SwiftJavaToolLibTests/CompileJavaWrapTools.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,11 @@ func assertWrapJavaOutput(
151151
}
152152

153153
for expectedChunk in expectedChunks {
154-
if swiftCompleteOutputText.contains(expectedChunk) {
154+
// We make the matching in-sensitive to whitespace:
155+
let checkAgainstText = swiftCompleteOutputText.replacing(" ", with: "")
156+
let checkAgainstExpectedChunk = expectedChunk.replacing(" ", with: "")
157+
158+
if checkAgainstText.contains(checkAgainstExpectedChunk) {
155159
continue
156160
}
157161

@@ -162,6 +166,4 @@ func assertWrapJavaOutput(
162166
"\(swiftCompleteOutputText)",
163167
file: file, line: line)
164168
}
165-
166-
print(swiftCompleteOutputText)
167169
}

Tests/SwiftJavaToolLibTests/WrapJavaTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,11 @@ class WrapJavaTests: XCTestCase {
114114
}
115115
class Pair<First, Second> { }
116116
117-
class ExampleSimpleClass {
117+
final class ExampleSimpleClass {
118118
// use in return type
119-
<KeyType, NotUsedParam> KeyType getGeneric() { return null; }
119+
<KeyType, NotUsedParam> KeyType getGeneric() {
120+
return null;
121+
}
120122
}
121123
""")
122124

0 commit comments

Comments
 (0)