|
0 |
Index: quick-xml/tests/test.rs
|
|
1 |
===================================================================
|
|
2 |
--- quick-xml.orig/tests/test.rs
|
|
3 |
+++ quick-xml/tests/test.rs
|
|
4 |
@@ -12,24 +12,6 @@ use std::io::Cursor;
|
|
5 |
use serde::{Deserialize, Serialize};
|
|
6 |
|
|
7 |
#[test]
|
|
8 |
-fn test_sample() {
|
|
9 |
- let src: &[u8] = include_bytes!("sample_rss.xml");
|
|
10 |
- let mut buf = Vec::new();
|
|
11 |
- let mut r = Reader::from_reader(src);
|
|
12 |
- let mut count = 0;
|
|
13 |
- loop {
|
|
14 |
- match r.read_event(&mut buf).unwrap() {
|
|
15 |
- Start(_) => count += 1,
|
|
16 |
- Decl(e) => println!("{:?}", e.version()),
|
|
17 |
- Eof => break,
|
|
18 |
- _ => (),
|
|
19 |
- }
|
|
20 |
- buf.clear();
|
|
21 |
- }
|
|
22 |
- println!("{}", count);
|
|
23 |
-}
|
|
24 |
-
|
|
25 |
-#[test]
|
|
26 |
fn test_attributes_empty() {
|
|
27 |
let src = b"<a att1='a' att2='b'/>";
|
|
28 |
let mut r = Reader::from_reader(src as &[u8]);
|
|
29 |
@@ -458,686 +440,3 @@ fn test_default_namespace() {
|
|
30 |
panic!("expecting outer end element with no namespace");
|
|
31 |
}
|
|
32 |
}
|
|
33 |
-
|
|
34 |
-#[cfg(feature = "serialize")]
|
|
35 |
-#[test]
|
|
36 |
-fn line_score() {
|
|
37 |
- #[derive(Debug, PartialEq, Deserialize)]
|
|
38 |
- struct LineScoreData {
|
|
39 |
- game_pk: u32,
|
|
40 |
- game_type: char,
|
|
41 |
- venue: String,
|
|
42 |
- venue_w_chan_loc: String,
|
|
43 |
- venue_id: u32,
|
|
44 |
- time: String,
|
|
45 |
- time_zone: String,
|
|
46 |
- ampm: String,
|
|
47 |
- home_team_id: u32,
|
|
48 |
- home_team_city: String,
|
|
49 |
- home_team_name: String,
|
|
50 |
- home_league_id: u32,
|
|
51 |
- away_team_id: u32,
|
|
52 |
- away_team_city: String,
|
|
53 |
- away_team_name: String,
|
|
54 |
- away_league_id: u32,
|
|
55 |
- #[serde(rename = "linescore", skip_serializing)]
|
|
56 |
- innings: Vec<LineScore>,
|
|
57 |
- }
|
|
58 |
- #[derive(Debug, PartialEq, Deserialize)]
|
|
59 |
- struct LineScore {
|
|
60 |
- #[serde(rename = "away_inning_runs")]
|
|
61 |
- away_runs: u32,
|
|
62 |
- #[serde(rename = "home_inning_runs")]
|
|
63 |
- //needs to be an Option, since home team doesn't always bat.
|
|
64 |
- home_runs: Option<u32>,
|
|
65 |
- // Keeping the inning as a string, since we'll need it to construct URLs later
|
|
66 |
- inning: String,
|
|
67 |
- }
|
|
68 |
-
|
|
69 |
- let res: LineScoreData = quick_xml::de::from_str(include_str!("linescore.xml")).unwrap();
|
|
70 |
-
|
|
71 |
- let expected = LineScoreData {
|
|
72 |
- game_pk: 239575,
|
|
73 |
- game_type: 'R',
|
|
74 |
- venue: "Generic".to_owned(),
|
|
75 |
- venue_w_chan_loc: "USNY0996".to_owned(),
|
|
76 |
- venue_id: 401,
|
|
77 |
- time: "Gm 2".to_owned(),
|
|
78 |
- time_zone: "ET".to_owned(),
|
|
79 |
- ampm: "AM".to_owned(),
|
|
80 |
- home_team_id: 611,
|
|
81 |
- home_team_city: "DSL Dodgers".to_owned(),
|
|
82 |
- home_team_name: "DSL Dodgers".to_owned(),
|
|
83 |
- home_league_id: 130,
|
|
84 |
- away_team_id: 604,
|
|
85 |
- away_team_city: "DSL Blue Jays1".to_owned(),
|
|
86 |
- away_team_name: "DSL Blue Jays1".to_owned(),
|
|
87 |
- away_league_id: 130,
|
|
88 |
- innings: vec![
|
|
89 |
- LineScore {
|
|
90 |
- away_runs: 1,
|
|
91 |
- home_runs: Some(0),
|
|
92 |
- inning: "1".to_owned(),
|
|
93 |
- },
|
|
94 |
- LineScore {
|
|
95 |
- away_runs: 0,
|
|
96 |
- home_runs: Some(0),
|
|
97 |
- inning: "2".to_owned(),
|
|
98 |
- },
|
|
99 |
- LineScore {
|
|
100 |
- away_runs: 1,
|
|
101 |
- home_runs: Some(1),
|
|
102 |
- inning: "3".to_owned(),
|
|
103 |
- },
|
|
104 |
- LineScore {
|
|
105 |
- away_runs: 2,
|
|
106 |
- home_runs: Some(0),
|
|
107 |
- inning: "4".to_owned(),
|
|
108 |
- },
|
|
109 |
- LineScore {
|
|
110 |
- away_runs: 0,
|
|
111 |
- home_runs: Some(0),
|
|
112 |
- inning: "5".to_owned(),
|
|
113 |
- },
|
|
114 |
- LineScore {
|
|
115 |
- away_runs: 0,
|
|
116 |
- home_runs: Some(0),
|
|
117 |
- inning: "6".to_owned(),
|
|
118 |
- },
|
|
119 |
- LineScore {
|
|
120 |
- away_runs: 0,
|
|
121 |
- home_runs: Some(0),
|
|
122 |
- inning: "7".to_owned(),
|
|
123 |
- },
|
|
124 |
- ],
|
|
125 |
- };
|
|
126 |
- assert_eq!(res, expected);
|
|
127 |
-}
|
|
128 |
-
|
|
129 |
-#[cfg(feature = "serialize")]
|
|
130 |
-#[test]
|
|
131 |
-fn players() {
|
|
132 |
- #[derive(PartialEq, Deserialize, Serialize, Debug)]
|
|
133 |
- struct Game {
|
|
134 |
- #[serde(rename = "team")]
|
|
135 |
- teams: Vec<Team>,
|
|
136 |
- //umpires: Umpires
|
|
137 |
- }
|
|
138 |
-
|
|
139 |
- #[derive(PartialEq, Deserialize, Serialize, Debug)]
|
|
140 |
- struct Team {
|
|
141 |
- #[serde(rename = "type")]
|
|
142 |
- home_away: HomeAway,
|
|
143 |
- id: String,
|
|
144 |
- name: String,
|
|
145 |
- #[serde(rename = "player")]
|
|
146 |
- players: Vec<Player>,
|
|
147 |
- #[serde(rename = "coach")]
|
|
148 |
- coaches: Vec<Coach>,
|
|
149 |
- }
|
|
150 |
-
|
|
151 |
- #[derive(PartialEq, Deserialize, Serialize, Debug)]
|
|
152 |
- enum HomeAway {
|
|
153 |
- #[serde(rename = "home")]
|
|
154 |
- Home,
|
|
155 |
- #[serde(rename = "away")]
|
|
156 |
- Away,
|
|
157 |
- }
|
|
158 |
-
|
|
159 |
- #[derive(PartialEq, Deserialize, Serialize, Debug, Clone)]
|
|
160 |
- struct Player {
|
|
161 |
- id: u32,
|
|
162 |
- #[serde(rename = "first")]
|
|
163 |
- name_first: String,
|
|
164 |
- #[serde(rename = "last")]
|
|
165 |
- name_last: String,
|
|
166 |
- game_position: Option<String>,
|
|
167 |
- bat_order: Option<u8>,
|
|
168 |
- position: String,
|
|
169 |
- }
|
|
170 |
-
|
|
171 |
- #[derive(PartialEq, Deserialize, Serialize, Debug)]
|
|
172 |
- struct Coach {
|
|
173 |
- position: String,
|
|
174 |
- #[serde(rename = "first")]
|
|
175 |
- name_first: String,
|
|
176 |
- #[serde(rename = "last")]
|
|
177 |
- name_last: String,
|
|
178 |
- id: u32,
|
|
179 |
- }
|
|
180 |
-
|
|
181 |
- let res: Game = quick_xml::de::from_str(include_str!("players.xml")).unwrap();
|
|
182 |
-
|
|
183 |
- let expected = Game {
|
|
184 |
- teams: vec![
|
|
185 |
- Team {
|
|
186 |
- home_away: HomeAway::Away,
|
|
187 |
- id: "CIN".to_owned(),
|
|
188 |
- name: "Cincinnati Reds".to_owned(),
|
|
189 |
- players: vec![
|
|
190 |
- Player {
|
|
191 |
- id: 115135,
|
|
192 |
- name_first: "Ken".to_owned(),
|
|
193 |
- name_last: "Griffey".to_owned(),
|
|
194 |
- game_position: Some("RF".to_owned()),
|
|
195 |
- bat_order: Some(3),
|
|
196 |
- position: "RF".to_owned(),
|
|
197 |
- },
|
|
198 |
- Player {
|
|
199 |
- id: 115608,
|
|
200 |
- name_first: "Scott".to_owned(),
|
|
201 |
- name_last: "Hatteberg".to_owned(),
|
|
202 |
- game_position: None,
|
|
203 |
- bat_order: None,
|
|
204 |
- position: "1B".to_owned(),
|
|
205 |
- },
|
|
206 |
- Player {
|
|
207 |
- id: 118967,
|
|
208 |
- name_first: "Kent".to_owned(),
|
|
209 |
- name_last: "Mercker".to_owned(),
|
|
210 |
- game_position: None,
|
|
211 |
- bat_order: None,
|
|
212 |
- position: "P".to_owned(),
|
|
213 |
- },
|
|
214 |
- Player {
|
|
215 |
- id: 136460,
|
|
216 |
- name_first: "Alex".to_owned(),
|
|
217 |
- name_last: "Gonzalez".to_owned(),
|
|
218 |
- game_position: None,
|
|
219 |
- bat_order: None,
|
|
220 |
- position: "SS".to_owned(),
|
|
221 |
- },
|
|
222 |
- Player {
|
|
223 |
- id: 150020,
|
|
224 |
- name_first: "Jerry".to_owned(),
|
|
225 |
- name_last: "Hairston".to_owned(),
|
|
226 |
- game_position: None,
|
|
227 |
- bat_order: None,
|
|
228 |
- position: "SS".to_owned(),
|
|
229 |
- },
|
|
230 |
- Player {
|
|
231 |
- id: 150188,
|
|
232 |
- name_first: "Francisco".to_owned(),
|
|
233 |
- name_last: "Cordero".to_owned(),
|
|
234 |
- game_position: None,
|
|
235 |
- bat_order: None,
|
|
236 |
- position: "P".to_owned(),
|
|
237 |
- },
|
|
238 |
- Player {
|
|
239 |
- id: 150221,
|
|
240 |
- name_first: "Mike".to_owned(),
|
|
241 |
- name_last: "Lincoln".to_owned(),
|
|
242 |
- game_position: None,
|
|
243 |
- bat_order: None,
|
|
244 |
- position: "P".to_owned(),
|
|
245 |
- },
|
|
246 |
- Player {
|
|
247 |
- id: 150319,
|
|
248 |
- name_first: "Josh".to_owned(),
|
|
249 |
- name_last: "Fogg".to_owned(),
|
|
250 |
- game_position: None,
|
|
251 |
- bat_order: None,
|
|
252 |
- position: "P".to_owned(),
|
|
253 |
- },
|
|
254 |
- Player {
|
|
255 |
- id: 150472,
|
|
256 |
- name_first: "Ryan".to_owned(),
|
|
257 |
- name_last: "Freel".to_owned(),
|
|
258 |
- game_position: Some("LF".to_owned()),
|
|
259 |
- bat_order: Some(2),
|
|
260 |
- position: "CF".to_owned(),
|
|
261 |
- },
|
|
262 |
- Player {
|
|
263 |
- id: 276520,
|
|
264 |
- name_first: "Bronson".to_owned(),
|
|
265 |
- name_last: "Arroyo".to_owned(),
|
|
266 |
- game_position: None,
|
|
267 |
- bat_order: None,
|
|
268 |
- position: "P".to_owned(),
|
|
269 |
- },
|
|
270 |
- Player {
|
|
271 |
- id: 279571,
|
|
272 |
- name_first: "Matt".to_owned(),
|
|
273 |
- name_last: "Belisle".to_owned(),
|
|
274 |
- game_position: Some("P".to_owned()),
|
|
275 |
- bat_order: Some(9),
|
|
276 |
- position: "P".to_owned(),
|
|
277 |
- },
|
|
278 |
- Player {
|
|
279 |
- id: 279913,
|
|
280 |
- name_first: "Corey".to_owned(),
|
|
281 |
- name_last: "Patterson".to_owned(),
|
|
282 |
- game_position: Some("CF".to_owned()),
|
|
283 |
- bat_order: Some(1),
|
|
284 |
- position: "CF".to_owned(),
|
|
285 |
- },
|
|
286 |
- Player {
|
|
287 |
- id: 346793,
|
|
288 |
- name_first: "Jeremy".to_owned(),
|
|
289 |
- name_last: "Affeldt".to_owned(),
|
|
290 |
- game_position: None,
|
|
291 |
- bat_order: None,
|
|
292 |
- position: "P".to_owned(),
|
|
293 |
- },
|
|
294 |
- Player {
|
|
295 |
- id: 408252,
|
|
296 |
- name_first: "Brandon".to_owned(),
|
|
297 |
- name_last: "Phillips".to_owned(),
|
|
298 |
- game_position: Some("2B".to_owned()),
|
|
299 |
- bat_order: Some(4),
|
|
300 |
- position: "2B".to_owned(),
|
|
301 |
- },
|
|
302 |
- Player {
|
|
303 |
- id: 421685,
|
|
304 |
- name_first: "Aaron".to_owned(),
|
|
305 |
- name_last: "Harang".to_owned(),
|
|
306 |
- game_position: None,
|
|
307 |
- bat_order: None,
|
|
308 |
- position: "P".to_owned(),
|
|
309 |
- },
|
|
310 |
- Player {
|
|
311 |
- id: 424325,
|
|
312 |
- name_first: "David".to_owned(),
|
|
313 |
- name_last: "Ross".to_owned(),
|
|
314 |
- game_position: Some("C".to_owned()),
|
|
315 |
- bat_order: Some(8),
|
|
316 |
- position: "C".to_owned(),
|
|
317 |
- },
|
|
318 |
- Player {
|
|
319 |
- id: 429665,
|
|
320 |
- name_first: "Edwin".to_owned(),
|
|
321 |
- name_last: "Encarnacion".to_owned(),
|
|
322 |
- game_position: Some("3B".to_owned()),
|
|
323 |
- bat_order: Some(6),
|
|
324 |
- position: "3B".to_owned(),
|
|
325 |
- },
|
|
326 |
- Player {
|
|
327 |
- id: 433898,
|
|
328 |
- name_first: "Jeff".to_owned(),
|
|
329 |
- name_last: "Keppinger".to_owned(),
|
|
330 |
- game_position: Some("SS".to_owned()),
|
|
331 |
- bat_order: Some(7),
|
|
332 |
- position: "SS".to_owned(),
|
|
333 |
- },
|
|
334 |
- Player {
|
|
335 |
- id: 435538,
|
|
336 |
- name_first: "Bill".to_owned(),
|
|
337 |
- name_last: "Bray".to_owned(),
|
|
338 |
- game_position: None,
|
|
339 |
- bat_order: None,
|
|
340 |
- position: "P".to_owned(),
|
|
341 |
- },
|
|
342 |
- Player {
|
|
343 |
- id: 440361,
|
|
344 |
- name_first: "Norris".to_owned(),
|
|
345 |
- name_last: "Hopper".to_owned(),
|
|
346 |
- game_position: None,
|
|
347 |
- bat_order: None,
|
|
348 |
- position: "O".to_owned(),
|
|
349 |
- },
|
|
350 |
- Player {
|
|
351 |
- id: 450172,
|
|
352 |
- name_first: "Edinson".to_owned(),
|
|
353 |
- name_last: "Volquez".to_owned(),
|
|
354 |
- game_position: None,
|
|
355 |
- bat_order: None,
|
|
356 |
- position: "P".to_owned(),
|
|
357 |
- },
|
|
358 |
- Player {
|
|
359 |
- id: 454537,
|
|
360 |
- name_first: "Jared".to_owned(),
|
|
361 |
- name_last: "Burton".to_owned(),
|
|
362 |
- game_position: None,
|
|
363 |
- bat_order: None,
|
|
364 |
- position: "P".to_owned(),
|
|
365 |
- },
|
|
366 |
- Player {
|
|
367 |
- id: 455751,
|
|
368 |
- name_first: "Bobby".to_owned(),
|
|
369 |
- name_last: "Livingston".to_owned(),
|
|
370 |
- game_position: None,
|
|
371 |
- bat_order: None,
|
|
372 |
- position: "P".to_owned(),
|
|
373 |
- },
|
|
374 |
- Player {
|
|
375 |
- id: 456501,
|
|
376 |
- name_first: "Johnny".to_owned(),
|
|
377 |
- name_last: "Cueto".to_owned(),
|
|
378 |
- game_position: None,
|
|
379 |
- bat_order: None,
|
|
380 |
- position: "P".to_owned(),
|
|
381 |
- },
|
|
382 |
- Player {
|
|
383 |
- id: 458015,
|
|
384 |
- name_first: "Joey".to_owned(),
|
|
385 |
- name_last: "Votto".to_owned(),
|
|
386 |
- game_position: Some("1B".to_owned()),
|
|
387 |
- bat_order: Some(5),
|
|
388 |
- position: "1B".to_owned(),
|
|
389 |
- },
|
|
390 |
- ],
|
|
391 |
- coaches: vec![
|
|
392 |
- Coach {
|
|
393 |
- position: "manager".to_owned(),
|
|
394 |
- name_first: "Dusty".to_owned(),
|
|
395 |
- name_last: "Baker".to_owned(),
|
|
396 |
- id: 110481,
|
|
397 |
- },
|
|
398 |
- Coach {
|
|
399 |
- position: "batting_coach".to_owned(),
|
|
400 |
- name_first: "Brook".to_owned(),
|
|
401 |
- name_last: "Jacoby".to_owned(),
|
|
402 |
- id: 116461,
|
|
403 |
- },
|
|
404 |
- Coach {
|
|
405 |
- position: "pitching_coach".to_owned(),
|
|
406 |
- name_first: "Dick".to_owned(),
|
|
407 |
- name_last: "Pole".to_owned(),
|
|
408 |
- id: 120649,
|
|
409 |
- },
|
|
410 |
- Coach {
|
|
411 |
- position: "first_base_coach".to_owned(),
|
|
412 |
- name_first: "Billy".to_owned(),
|
|
413 |
- name_last: "Hatcher".to_owned(),
|
|
414 |
- id: 115602,
|
|
415 |
- },
|
|
416 |
- Coach {
|
|
417 |
- position: "third_base_coach".to_owned(),
|
|
418 |
- name_first: "Mark".to_owned(),
|
|
419 |
- name_last: "Berry".to_owned(),
|
|
420 |
- id: 427028,
|
|
421 |
- },
|
|
422 |
- Coach {
|
|
423 |
- position: "bench_coach".to_owned(),
|
|
424 |
- name_first: "Chris".to_owned(),
|
|
425 |
- name_last: "Speier".to_owned(),
|
|
426 |
- id: 122573,
|
|
427 |
- },
|
|
428 |
- Coach {
|
|
429 |
- position: "bullpen_coach".to_owned(),
|
|
430 |
- name_first: "Juan".to_owned(),
|
|
431 |
- name_last: "Lopez".to_owned(),
|
|
432 |
- id: 427306,
|
|
433 |
- },
|
|
434 |
- Coach {
|
|
435 |
- position: "bullpen_catcher".to_owned(),
|
|
436 |
- name_first: "Mike".to_owned(),
|
|
437 |
- name_last: "Stefanski".to_owned(),
|
|
438 |
- id: 150464,
|
|
439 |
- },
|
|
440 |
- ],
|
|
441 |
- },
|
|
442 |
- Team {
|
|
443 |
- home_away: HomeAway::Home,
|
|
444 |
- id: "NYM".to_owned(),
|
|
445 |
- name: "New York Mets".to_owned(),
|
|
446 |
- players: vec![
|
|
447 |
- Player {
|
|
448 |
- id: 110189,
|
|
449 |
- name_first: "Moises".to_owned(),
|
|
450 |
- name_last: "Alou".to_owned(),
|
|
451 |
- game_position: Some("LF".to_owned()),
|
|
452 |
- bat_order: Some(6),
|
|
453 |
- position: "LF".to_owned(),
|
|
454 |
- },
|
|
455 |
- Player {
|
|
456 |
- id: 112116,
|
|
457 |
- name_first: "Luis".to_owned(),
|
|
458 |
- name_last: "Castillo".to_owned(),
|
|
459 |
- game_position: Some("2B".to_owned()),
|
|
460 |
- bat_order: Some(2),
|
|
461 |
- position: "2B".to_owned(),
|
|
462 |
- },
|
|
463 |
- Player {
|
|
464 |
- id: 113232,
|
|
465 |
- name_first: "Carlos".to_owned(),
|
|
466 |
- name_last: "Delgado".to_owned(),
|
|
467 |
- game_position: Some("1B".to_owned()),
|
|
468 |
- bat_order: Some(7),
|
|
469 |
- position: "1B".to_owned(),
|
|
470 |
- },
|
|
471 |
- Player {
|
|
472 |
- id: 113702,
|
|
473 |
- name_first: "Damion".to_owned(),
|
|
474 |
- name_last: "Easley".to_owned(),
|
|
475 |
- game_position: None,
|
|
476 |
- bat_order: None,
|
|
477 |
- position: "2B".to_owned(),
|
|
478 |
- },
|
|
479 |
- Player {
|
|
480 |
- id: 118377,
|
|
481 |
- name_first: "Pedro".to_owned(),
|
|
482 |
- name_last: "Martinez".to_owned(),
|
|
483 |
- game_position: None,
|
|
484 |
- bat_order: None,
|
|
485 |
- position: "P".to_owned(),
|
|
486 |
- },
|
|
487 |
- Player {
|
|
488 |
- id: 123790,
|
|
489 |
- name_first: "Billy".to_owned(),
|
|
490 |
- name_last: "Wagner".to_owned(),
|
|
491 |
- game_position: None,
|
|
492 |
- bat_order: None,
|
|
493 |
- position: "P".to_owned(),
|
|
494 |
- },
|
|
495 |
- Player {
|
|
496 |
- id: 133340,
|
|
497 |
- name_first: "Orlando".to_owned(),
|
|
498 |
- name_last: "Hernandez".to_owned(),
|
|
499 |
- game_position: None,
|
|
500 |
- bat_order: None,
|
|
501 |
- position: "P".to_owned(),
|
|
502 |
- },
|
|
503 |
- Player {
|
|
504 |
- id: 135783,
|
|
505 |
- name_first: "Ramon".to_owned(),
|
|
506 |
- name_last: "Castro".to_owned(),
|
|
507 |
- game_position: None,
|
|
508 |
- bat_order: None,
|
|
509 |
- position: "C".to_owned(),
|
|
510 |
- },
|
|
511 |
- Player {
|
|
512 |
- id: 136724,
|
|
513 |
- name_first: "Marlon".to_owned(),
|
|
514 |
- name_last: "Anderson".to_owned(),
|
|
515 |
- game_position: None,
|
|
516 |
- bat_order: None,
|
|
517 |
- position: "LF".to_owned(),
|
|
518 |
- },
|
|
519 |
- Player {
|
|
520 |
- id: 136860,
|
|
521 |
- name_first: "Carlos".to_owned(),
|
|
522 |
- name_last: "Beltran".to_owned(),
|
|
523 |
- game_position: Some("CF".to_owned()),
|
|
524 |
- bat_order: Some(4),
|
|
525 |
- position: "CF".to_owned(),
|
|
526 |
- },
|
|
527 |
- Player {
|
|
528 |
- id: 150411,
|
|
529 |
- name_first: "Brian".to_owned(),
|
|
530 |
- name_last: "Schneider".to_owned(),
|
|
531 |
- game_position: Some("C".to_owned()),
|
|
532 |
- bat_order: Some(8),
|
|
533 |
- position: "C".to_owned(),
|
|
534 |
- },
|
|
535 |
- Player {
|
|
536 |
- id: 276371,
|
|
537 |
- name_first: "Johan".to_owned(),
|
|
538 |
- name_last: "Santana".to_owned(),
|
|
539 |
- game_position: Some("P".to_owned()),
|
|
540 |
- bat_order: Some(9),
|
|
541 |
- position: "P".to_owned(),
|
|
542 |
- },
|
|
543 |
- Player {
|
|
544 |
- id: 277184,
|
|
545 |
- name_first: "Matt".to_owned(),
|
|
546 |
- name_last: "Wise".to_owned(),
|
|
547 |
- game_position: None,
|
|
548 |
- bat_order: None,
|
|
549 |
- position: "P".to_owned(),
|
|
550 |
- },
|
|
551 |
- Player {
|
|
552 |
- id: 346795,
|
|
553 |
- name_first: "Endy".to_owned(),
|
|
554 |
- name_last: "Chavez".to_owned(),
|
|
555 |
- game_position: None,
|
|
556 |
- bat_order: None,
|
|
557 |
- position: "RF".to_owned(),
|
|
558 |
- },
|
|
559 |
- Player {
|
|
560 |
- id: 407901,
|
|
561 |
- name_first: "Jorge".to_owned(),
|
|
562 |
- name_last: "Sosa".to_owned(),
|
|
563 |
- game_position: None,
|
|
564 |
- bat_order: None,
|
|
565 |
- position: "P".to_owned(),
|
|
566 |
- },
|
|
567 |
- Player {
|
|
568 |
- id: 408230,
|
|
569 |
- name_first: "Pedro".to_owned(),
|
|
570 |
- name_last: "Feliciano".to_owned(),
|
|
571 |
- game_position: None,
|
|
572 |
- bat_order: None,
|
|
573 |
- position: "P".to_owned(),
|
|
574 |
- },
|
|
575 |
- Player {
|
|
576 |
- id: 408310,
|
|
577 |
- name_first: "Aaron".to_owned(),
|
|
578 |
- name_last: "Heilman".to_owned(),
|
|
579 |
- game_position: None,
|
|
580 |
- bat_order: None,
|
|
581 |
- position: "P".to_owned(),
|
|
582 |
- },
|
|
583 |
- Player {
|
|
584 |
- id: 408314,
|
|
585 |
- name_first: "Jose".to_owned(),
|
|
586 |
- name_last: "Reyes".to_owned(),
|
|
587 |
- game_position: Some("SS".to_owned()),
|
|
588 |
- bat_order: Some(1),
|
|
589 |
- position: "SS".to_owned(),
|
|
590 |
- },
|
|
591 |
- Player {
|
|
592 |
- id: 425508,
|
|
593 |
- name_first: "Ryan".to_owned(),
|
|
594 |
- name_last: "Church".to_owned(),
|
|
595 |
- game_position: Some("RF".to_owned()),
|
|
596 |
- bat_order: Some(5),
|
|
597 |
- position: "RF".to_owned(),
|
|
598 |
- },
|
|
599 |
- Player {
|
|
600 |
- id: 429720,
|
|
601 |
- name_first: "John".to_owned(),
|
|
602 |
- name_last: "Maine".to_owned(),
|
|
603 |
- game_position: None,
|
|
604 |
- bat_order: None,
|
|
605 |
- position: "P".to_owned(),
|
|
606 |
- },
|
|
607 |
- Player {
|
|
608 |
- id: 431151,
|
|
609 |
- name_first: "David".to_owned(),
|
|
610 |
- name_last: "Wright".to_owned(),
|
|
611 |
- game_position: Some("3B".to_owned()),
|
|
612 |
- bat_order: Some(3),
|
|
613 |
- position: "3B".to_owned(),
|
|
614 |
- },
|
|
615 |
- Player {
|
|
616 |
- id: 434586,
|
|
617 |
- name_first: "Ambiorix".to_owned(),
|
|
618 |
- name_last: "Burgos".to_owned(),
|
|
619 |
- game_position: None,
|
|
620 |
- bat_order: None,
|
|
621 |
- position: "P".to_owned(),
|
|
622 |
- },
|
|
623 |
- Player {
|
|
624 |
- id: 434636,
|
|
625 |
- name_first: "Angel".to_owned(),
|
|
626 |
- name_last: "Pagan".to_owned(),
|
|
627 |
- game_position: None,
|
|
628 |
- bat_order: None,
|
|
629 |
- position: "LF".to_owned(),
|
|
630 |
- },
|
|
631 |
- Player {
|
|
632 |
- id: 450306,
|
|
633 |
- name_first: "Jason".to_owned(),
|
|
634 |
- name_last: "Vargas".to_owned(),
|
|
635 |
- game_position: None,
|
|
636 |
- bat_order: None,
|
|
637 |
- position: "P".to_owned(),
|
|
638 |
- },
|
|
639 |
- Player {
|
|
640 |
- id: 460059,
|
|
641 |
- name_first: "Mike".to_owned(),
|
|
642 |
- name_last: "Pelfrey".to_owned(),
|
|
643 |
- game_position: None,
|
|
644 |
- bat_order: None,
|
|
645 |
- position: "P".to_owned(),
|
|
646 |
- },
|
|
647 |
- ],
|
|
648 |
- coaches: vec![
|
|
649 |
- Coach {
|
|
650 |
- position: "manager".to_owned(),
|
|
651 |
- name_first: "Willie".to_owned(),
|
|
652 |
- name_last: "Randolph".to_owned(),
|
|
653 |
- id: 120927,
|
|
654 |
- },
|
|
655 |
- Coach {
|
|
656 |
- position: "batting_coach".to_owned(),
|
|
657 |
- name_first: "Howard".to_owned(),
|
|
658 |
- name_last: "Johnson".to_owned(),
|
|
659 |
- id: 116593,
|
|
660 |
- },
|
|
661 |
- Coach {
|
|
662 |
- position: "pitching_coach".to_owned(),
|
|
663 |
- name_first: "Rick".to_owned(),
|
|
664 |
- name_last: "Peterson".to_owned(),
|
|
665 |
- id: 427395,
|
|
666 |
- },
|
|
667 |
- Coach {
|
|
668 |
- position: "first_base_coach".to_owned(),
|
|
669 |
- name_first: "Tom".to_owned(),
|
|
670 |
- name_last: "Nieto".to_owned(),
|
|
671 |
- id: 119796,
|
|
672 |
- },
|
|
673 |
- Coach {
|
|
674 |
- position: "third_base_coach".to_owned(),
|
|
675 |
- name_first: "Sandy".to_owned(),
|
|
676 |
- name_last: "Alomar".to_owned(),
|
|
677 |
- id: 110185,
|
|
678 |
- },
|
|
679 |
- Coach {
|
|
680 |
- position: "bench_coach".to_owned(),
|
|
681 |
- name_first: "Jerry".to_owned(),
|
|
682 |
- name_last: "Manuel".to_owned(),
|
|
683 |
- id: 118262,
|
|
684 |
- },
|
|
685 |
- Coach {
|
|
686 |
- position: "bullpen_coach".to_owned(),
|
|
687 |
- name_first: "Guy".to_owned(),
|
|
688 |
- name_last: "Conti".to_owned(),
|
|
689 |
- id: 434699,
|
|
690 |
- },
|
|
691 |
- Coach {
|
|
692 |
- position: "bullpen_catcher".to_owned(),
|
|
693 |
- name_first: "Dave".to_owned(),
|
|
694 |
- name_last: "Racaniello".to_owned(),
|
|
695 |
- id: 534948,
|
|
696 |
- },
|
|
697 |
- Coach {
|
|
698 |
- position: "coach".to_owned(),
|
|
699 |
- name_first: "Sandy".to_owned(),
|
|
700 |
- name_last: "Alomar".to_owned(),
|
|
701 |
- id: 110184,
|
|
702 |
- },
|
|
703 |
- Coach {
|
|
704 |
- position: "coach".to_owned(),
|
|
705 |
- name_first: "Juan".to_owned(),
|
|
706 |
- name_last: "Lopez".to_owned(),
|
|
707 |
- id: 495390,
|
|
708 |
- },
|
|
709 |
- ],
|
|
710 |
- },
|
|
711 |
- ],
|
|
712 |
- };
|
|
713 |
-
|
|
714 |
- assert_eq!(res, expected);
|
|
715 |
-}
|