@@ -83,7 +83,7 @@ final class MethodImportTests {
8383 javaOutputDirectory: " /fake "
8484 )
8585
86- let funcDecl = st. importedGlobalFuncs. first { $0. name == " helloWorld " } !
86+ let funcDecl = try #require ( st. importedGlobalFuncs. first { $0. name == " helloWorld " } )
8787
8888 let output = CodePrinter . toString { printer in
8989 generator. printJavaBindingWrapperMethod ( & printer, funcDecl)
@@ -117,9 +117,11 @@ final class MethodImportTests {
117117
118118 try st. analyze ( path: " Fake.swift " , text: class_interfaceFile)
119119
120- let funcDecl = st. importedGlobalFuncs. first {
121- $0. name == " globalTakeInt "
122- } !
120+ let funcDecl = try #require(
121+ st. importedGlobalFuncs. first {
122+ $0. name == " globalTakeInt "
123+ }
124+ )
123125
124126 let generator = FFMSwift2JavaGenerator (
125127 config: config,
@@ -164,9 +166,11 @@ final class MethodImportTests {
164166
165167 try st. analyze ( path: " Fake.swift " , text: class_interfaceFile)
166168
167- let funcDecl = st. importedGlobalFuncs. first {
168- $0. name == " globalTakeIntLongString "
169- } !
169+ let funcDecl = try #require(
170+ st. importedGlobalFuncs. first {
171+ $0. name == " globalTakeIntLongString "
172+ }
173+ )
170174
171175 let generator = FFMSwift2JavaGenerator (
172176 config: config,
@@ -208,9 +212,11 @@ final class MethodImportTests {
208212
209213 try st. analyze ( path: " Fake.swift " , text: class_interfaceFile)
210214
211- let funcDecl = st. importedGlobalFuncs. first {
212- $0. name == " globalReturnClass "
213- } !
215+ let funcDecl = try #require(
216+ st. importedGlobalFuncs. first {
217+ $0. name == " globalReturnClass "
218+ }
219+ )
214220
215221 let generator = FFMSwift2JavaGenerator (
216222 config: config,
@@ -252,9 +258,11 @@ final class MethodImportTests {
252258
253259 try st. analyze ( path: " Fake.swift " , text: class_interfaceFile)
254260
255- let funcDecl = st. importedGlobalFuncs. first {
256- $0. name == " swapRawBufferPointer "
257- } !
261+ let funcDecl = try #require(
262+ st. importedGlobalFuncs. first {
263+ $0. name == " swapRawBufferPointer "
264+ }
265+ )
258266
259267 let generator = FFMSwift2JavaGenerator (
260268 config: config,
@@ -299,9 +307,11 @@ final class MethodImportTests {
299307
300308 try st. analyze ( path: " Fake.swift " , text: class_interfaceFile)
301309
302- let funcDecl : ImportedFunc = st. importedTypes [ " MySwiftClass " ] !. methods. first {
303- $0. name == " helloMemberFunction "
304- } !
310+ let funcDecl : ImportedFunc = try #require(
311+ st. importedTypes [ " MySwiftClass " ] !. methods. first {
312+ $0. name == " helloMemberFunction "
313+ }
314+ )
305315
306316 let generator = FFMSwift2JavaGenerator (
307317 config: config,
@@ -342,9 +352,11 @@ final class MethodImportTests {
342352
343353 try st. analyze ( path: " Fake.swift " , text: class_interfaceFile)
344354
345- let funcDecl : ImportedFunc = st. importedTypes [ " MySwiftClass " ] !. methods. first {
346- $0. name == " makeInt "
347- } !
355+ let funcDecl : ImportedFunc = try #require(
356+ st. importedTypes [ " MySwiftClass " ] !. methods. first {
357+ $0. name == " makeInt "
358+ }
359+ )
348360
349361 let generator = FFMSwift2JavaGenerator (
350362 config: config,
@@ -391,9 +403,11 @@ final class MethodImportTests {
391403
392404 try st. analyze ( path: " Fake.swift " , text: class_interfaceFile)
393405
394- let initDecl : ImportedFunc = st. importedTypes [ " MySwiftClass " ] !. initializers. first {
395- $0. name == " init "
396- } !
406+ let initDecl : ImportedFunc = try #require(
407+ st. importedTypes [ " MySwiftClass " ] !. initializers. first {
408+ $0. name == " init "
409+ }
410+ )
397411
398412 let generator = FFMSwift2JavaGenerator (
399413 config: config,
@@ -444,9 +458,11 @@ final class MethodImportTests {
444458
445459 try st. analyze ( path: " Fake.swift " , text: class_interfaceFile)
446460
447- let initDecl : ImportedFunc = st. importedTypes [ " MySwiftStruct " ] !. initializers. first {
448- $0. name == " init "
449- } !
461+ let initDecl : ImportedFunc = try #require(
462+ st. importedTypes [ " MySwiftStruct " ] !. initializers. first {
463+ $0. name == " init "
464+ }
465+ )
450466
451467 let generator = FFMSwift2JavaGenerator (
452468 config: config,
0 commit comments