@@ -16,10 +16,10 @@ struct ContentBlockTests {
1616 @Test func decodesToolUse( ) throws {
1717 let json = """
1818 {
19- " type " : " tool_use " ,
20- " id " : " toolu_123 " ,
21- " name " : " bash " ,
22- " input " : { " command " : " ls " }
19+ " type " : " tool_use " ,
20+ " id " : " toolu_123 " ,
21+ " name " : " bash " ,
22+ " input " : { " command " : " ls " }
2323 }
2424 """
2525 let block = try JSONDecoder ( ) . decode ( ContentBlock . self, from: Data ( json. utf8) )
@@ -36,10 +36,10 @@ struct ContentBlockTests {
3636 @Test func decodesToolResult( ) throws {
3737 let json = """
3838 {
39- " type " : " tool_result " ,
40- " tool_use_id " : " toolu_789 " ,
41- " content " : " output text " ,
42- " is_error " : true
39+ " type " : " tool_result " ,
40+ " tool_use_id " : " toolu_789 " ,
41+ " content " : " output text " ,
42+ " is_error " : true
4343 }
4444 """
4545 let block = try JSONDecoder ( ) . decode ( ContentBlock . self, from: Data ( json. utf8) )
@@ -64,15 +64,15 @@ struct ContentBlockTests {
6464 let blocks : [ ContentBlock ] = [
6565 . text( " Hello " ) ,
6666 . toolUse( id: " t1 " , name: " bash " , input: . object( [ " command " : " ls " ] ) ) ,
67- . text( " World " ) ,
67+ . text( " World " )
6868 ]
6969 #expect( blocks. textContent == " Hello \n World " )
7070 }
7171
7272 @Test func textContentEmptyWhenNoTextBlocks( ) {
7373 let blocks : [ ContentBlock ] = [
7474 . toolUse( id: " t1 " , name: " bash " , input: . object( [ " command " : " ls " ] ) ) ,
75- . toolResult( toolUseId: " t1 " , content: " output " , isError: false ) ,
75+ . toolResult( toolUseId: " t1 " , content: " output " , isError: false )
7676 ]
7777 #expect( blocks. textContent == " " )
7878 }
@@ -93,7 +93,7 @@ struct MessageTests {
9393 role: . assistant,
9494 content: [
9595 . text( " Let me run that. " ) ,
96- . toolUse( id: " toolu_abc " , name: " bash " , input: . object( [ " command " : " pwd " ] ) ) ,
96+ . toolUse( id: " toolu_abc " , name: " bash " , input: . object( [ " command " : " pwd " ] ) )
9797 ]
9898 )
9999
@@ -113,7 +113,7 @@ struct StopReasonTests {
113113 arguments: [
114114 ( #""end_turn""# , StopReason . endTurn) ,
115115 ( #""tool_use""# , StopReason . toolUse) ,
116- ( #""max_tokens""# , StopReason . maxTokens) ,
116+ ( #""max_tokens""# , StopReason . maxTokens)
117117 ]
118118 )
119119 func decodes( json: String , expected: StopReason ) throws {
@@ -141,7 +141,7 @@ struct APIRequestTests {
141141 " properties " : . object( [
142142 " command " : . object( [ " type " : " string " ] )
143143 ] ) ,
144- " required " : . array( [ " command " ] ) ,
144+ " required " : . array( [ " command " ] )
145145 ] )
146146 )
147147 ]
@@ -162,17 +162,17 @@ struct APIResponseTests {
162162 @Test func decodes( ) throws {
163163 let json = """
164164 {
165- " id " : " msg_abc123 " ,
166- " type " : " message " ,
167- " role " : " assistant " ,
168- " content " : [
169- { " type " : " text " , " text " : " Here are the files. " }
170- ],
171- " stop_reason " : " end_turn " ,
172- " usage " : {
173- " input_tokens " : 100,
174- " output_tokens " : 50
175- }
165+ " id " : " msg_abc123 " ,
166+ " type " : " message " ,
167+ " role " : " assistant " ,
168+ " content " : [
169+ { " type " : " text " , " text " : " Here are the files. " }
170+ ],
171+ " stop_reason " : " end_turn " ,
172+ " usage " : {
173+ " input_tokens " : 100,
174+ " output_tokens " : 50
175+ }
176176 }
177177 """
178178 let response = try JSONDecoder ( ) . decode ( APIResponse . self, from: Data ( json. utf8) )
@@ -190,11 +190,11 @@ struct APIErrorTests {
190190 @Test func decodesErrorResponse( ) throws {
191191 let json = """
192192 {
193- " type " : " error " ,
194- " error " : {
195- " type " : " invalid_request_error " ,
196- " message " : " max_tokens must be positive "
197- }
193+ " type " : " error " ,
194+ " error " : {
195+ " type " : " invalid_request_error " ,
196+ " message " : " max_tokens must be positive "
197+ }
198198 }
199199 """
200200 let response = try JSONDecoder ( ) . decode ( APIErrorResponse . self, from: Data ( json. utf8) )
0 commit comments