@@ -71,7 +71,7 @@ port_receive(Port, Acc) ->
7171
7272port_jiffy_test ()->
7373 Tests = test_data_jiffy (),
74- ? assertEqual ({[Tests ],<<>>}, msgpack :unpack (msgpack :pack ([Tests ], [jiffy ]), [jiffy )),
74+ ? assertEqual ({[Tests ],<<>>}, msgpack :unpack (msgpack :pack ([Tests ], [{ format , jiffy } ]), [{ format , jiffy }] )),
7575
7676 % Port = open_port({spawn, "ruby ../test/crosslang.rb"}, [binary, eof]),
7777 % true = port_command(Port, msgpack:pack(Tests)),
@@ -82,7 +82,7 @@ port_jiffy_test()->
8282
8383port_jsx_test ()->
8484 Tests = test_data_jsx (),
85- ? assertEqual ({[Tests ],<<>>}, msgpack :unpack (msgpack :pack ([Tests ], [jsx ]), [jsx ])),
85+ ? assertEqual ({[Tests ],<<>>}, msgpack :unpack (msgpack :pack ([Tests ], [{ format , jsx } ]), [{ format , jsx } ])),
8686
8787 % Port = open_port({spawn, "ruby ../test/crosslang.rb"}, [binary, eof]),
8888 % true = port_command(Port, msgpack:pack(Tests)),
@@ -117,13 +117,13 @@ issue_jsx_5_test() ->
117117 ]
118118 }
119119 ],
120- Encoded = msgpack :pack (Term , [jsx , {enable_str ,true }]),
120+ Encoded = msgpack :pack (Term , [{ format , jsx }, {enable_str ,true }]),
121121 Bin0 = <<130 ,196 ,4 ,116 ,121 ,112 ,101 ,196 ,7 ,119 ,111 ,114 ,107 ,101 ,114 ,115 ,
122122 196 ,4 ,100 ,97 ,116 ,97 ,145 ,130 ,196 ,8 ,119 ,111 ,114 ,107 ,101 ,114 ,105 ,100 ,
123123 196 ,5 ,115 ,116 ,100 ,46 ,49 ,196 ,5 ,115 ,108 ,111 ,116 ,115 ,160 >>,
124124 ? assertEqual (Bin0 , Encoded ),
125125
126- {ok , Decoded } = msgpack :unpack (Bin0 , [jsx , {enable_str ,true }]),
126+ {ok , Decoded } = msgpack :unpack (Bin0 , [{ format , jsx }, {enable_str ,true }]),
127127 ? assertEqual (Term , Decoded ).
128128
129129
@@ -136,13 +136,13 @@ issue_jiffy_5_test() ->
136136 ]
137137 }
138138 ]},
139- Encoded = msgpack :pack (Term , [jiffy , {enable_str ,true }]),
139+ Encoded = msgpack :pack (Term , [{ format , jiffy }, {enable_str ,true }]),
140140 Bin0 = <<130 ,196 ,4 ,116 ,121 ,112 ,101 ,196 ,7 ,119 ,111 ,114 ,107 ,101 ,114 ,115 ,
141141 196 ,4 ,100 ,97 ,116 ,97 ,145 ,130 ,196 ,8 ,119 ,111 ,114 ,107 ,101 ,114 ,105 ,100 ,
142142 196 ,5 ,115 ,116 ,100 ,46 ,49 ,196 ,5 ,115 ,108 ,111 ,116 ,115 ,160 >>,
143143 ? assertEqual (Bin0 , Encoded ),
144144
145- {ok , Decoded } = msgpack :unpack (Bin0 , [jiffy , {enable_str ,true }]),
145+ {ok , Decoded } = msgpack :unpack (Bin0 , [{ format , jiffy }, {enable_str ,true }]),
146146 ? assertEqual (Term , Decoded ).
147147
148148
@@ -195,38 +195,38 @@ map_test_()->
195195 {" jiffy length 16" ,
196196 fun () ->
197197 Map = {[ {X , X * 2 } || X <- lists :seq (0 , 16 ) ]},
198- Binary = pack (Map , [jiffy ]),
199- ? assertEqual ({ok , Map }, unpack (Binary , [jiffy ]))
198+ Binary = pack (Map , [{ format , jiffy } ]),
199+ ? assertEqual ({ok , Map }, unpack (Binary , [{ format , jiffy } ]))
200200 end },
201201 {" jiffy length 32" ,
202202 fun () ->
203203 Map = {[ {X , X * 2 } || X <- lists :seq (0 , 16#010000 ) ]},
204- Binary = pack (Map , [jiffy ]),
205- ? assertEqual ({ok , Map }, unpack (Binary , [jiffy ]))
204+ Binary = pack (Map , [{ format , jiffy } ]),
205+ ? assertEqual ({ok , Map }, unpack (Binary , [{ format , jiffy } ]))
206206 end },
207207 {" jiffy empty" ,
208208 fun () ->
209209 EmptyMap = {[]},
210- Binary = pack (EmptyMap , [jiffy ]),
211- ? assertEqual ({ok , EmptyMap }, unpack (Binary , [jiffy ]))
210+ Binary = pack (EmptyMap , [{ format , jiffy } ]),
211+ ? assertEqual ({ok , EmptyMap }, unpack (Binary , [{ format , jiffy } ]))
212212 end },
213213 {" jsx length 16" ,
214214 fun () ->
215215 Map = [ {X , X * 2 } || X <- lists :seq (0 , 16 ) ],
216- Binary = pack (Map , [jsx ]),
217- ? assertEqual ({ok , Map }, unpack (Binary , [jsx ]))
216+ Binary = pack (Map , [{ format , jsx } ]),
217+ ? assertEqual ({ok , Map }, unpack (Binary , [{ format , jsx } ]))
218218 end },
219219 {" jsx length 32" ,
220220 fun () ->
221221 Map = [ {X , X * 2 } || X <- lists :seq (0 , 16#010000 ) ],
222- Binary = pack (Map , [jsx ]),
223- ? assertEqual ({ok , Map }, unpack (Binary , [jsx ]))
222+ Binary = pack (Map , [{ format , jsx } ]),
223+ ? assertEqual ({ok , Map }, unpack (Binary , [{ format , jsx } ]))
224224 end },
225225 {" jsx empty" ,
226226 fun () ->
227227 EmptyMap = [{}],
228- Binary = pack (EmptyMap , [jsx ]),
229- ? assertEqual ({ok , EmptyMap }, unpack (Binary , [jsx ]))
228+ Binary = pack (EmptyMap , [{ format , jsx } ]),
229+ ? assertEqual ({ok , EmptyMap }, unpack (Binary , [{ format , jsx } ]))
230230 end }
231231 ].
232232
0 commit comments