@@ -70,6 +70,7 @@ final class GenerativeModelTests: XCTestCase {
70
70
let partText = try XCTUnwrap ( part. text)
71
71
XCTAssertTrue ( partText. hasPrefix ( " You can ask me a wide range of questions " ) )
72
72
XCTAssertEqual ( response. text, partText)
73
+ XCTAssertEqual ( response. functionCalls, [ ] )
73
74
}
74
75
75
76
func testGenerateContent_success_basicReplyShort( ) async throws {
@@ -90,6 +91,7 @@ final class GenerativeModelTests: XCTestCase {
90
91
let part = try XCTUnwrap ( candidate. content. parts. first)
91
92
XCTAssertEqual ( part. text, " Mountain View, California, United States " )
92
93
XCTAssertEqual ( response. text, part. text)
94
+ XCTAssertEqual ( response. functionCalls, [ ] )
93
95
}
94
96
95
97
func testGenerateContent_success_citations( ) async throws {
@@ -195,6 +197,7 @@ final class GenerativeModelTests: XCTestCase {
195
197
}
196
198
XCTAssertEqual ( functionCall. name, " current_time " )
197
199
XCTAssertTrue ( functionCall. args. isEmpty)
200
+ XCTAssertEqual ( response. functionCalls, [ functionCall] )
198
201
}
199
202
200
203
func testGenerateContent_success_functionCall_noArguments( ) async throws {
@@ -216,6 +219,7 @@ final class GenerativeModelTests: XCTestCase {
216
219
}
217
220
XCTAssertEqual ( functionCall. name, " current_time " )
218
221
XCTAssertTrue ( functionCall. args. isEmpty)
222
+ XCTAssertEqual ( response. functionCalls, [ functionCall] )
219
223
}
220
224
221
225
func testGenerateContent_success_functionCall_withArguments( ) async throws {
@@ -241,6 +245,7 @@ final class GenerativeModelTests: XCTestCase {
241
245
XCTAssertEqual ( argX, . number( 4 ) )
242
246
let argY = try XCTUnwrap ( functionCall. args [ " y " ] )
243
247
XCTAssertEqual ( argY, . number( 5 ) )
248
+ XCTAssertEqual ( response. functionCalls, [ functionCall] )
244
249
}
245
250
246
251
func testGenerateContent_appCheck_validToken( ) async throws {
0 commit comments