forked from mirrors/gstreamer-rs
gstreamer: Fix serde serialization tests
ron serialization is now writing `1.0` instead of just `1`.
This commit is contained in:
parent
6b47d646c0
commit
b28664ccbd
5 changed files with 12 additions and 12 deletions
|
@ -182,7 +182,7 @@ mod tests {
|
||||||
let datetime = DateTime::new(2f32, 2018, 5, 28, 16, 6, 42.123_456f64).unwrap();
|
let datetime = DateTime::new(2f32, 2018, 5, 28, 16, 6, 42.123_456f64).unwrap();
|
||||||
let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone());
|
let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone());
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
Ok("YMDhmsTz(2018, 5, 28, 16, 6, 42.123456, 2)".to_owned()),
|
Ok("YMDhmsTz(2018, 5, 28, 16, 6, 42.123456, 2.0)".to_owned()),
|
||||||
res,
|
res,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ mod tests {
|
||||||
|
|
||||||
let datetime = DateTime::new(2f32, 2018, 5, 28, 16, 6, None).unwrap();
|
let datetime = DateTime::new(2f32, 2018, 5, 28, 16, 6, None).unwrap();
|
||||||
let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone());
|
let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone());
|
||||||
assert_eq!(Ok("YMDhmTz(2018, 5, 28, 16, 6, 2)".to_owned()), res,);
|
assert_eq!(Ok("YMDhmTz(2018, 5, 28, 16, 6, 2.0)".to_owned()), res,);
|
||||||
|
|
||||||
let datetime = DateTime::from_ymd(2018, 5, 28).unwrap();
|
let datetime = DateTime::from_ymd(2018, 5, 28).unwrap();
|
||||||
let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone());
|
let res = ron::ser::to_string_pretty(&datetime, pretty_config.clone());
|
||||||
|
|
|
@ -154,7 +154,7 @@ mod tests {
|
||||||
" ])),",
|
" ])),",
|
||||||
" segment: Some((",
|
" segment: Some((",
|
||||||
" flags: \"reset+segment\",",
|
" flags: \"reset+segment\",",
|
||||||
" rate: 1,",
|
" rate: 1.0,",
|
||||||
" applied_rate: 0.9,",
|
" applied_rate: 0.9,",
|
||||||
" format: Time,",
|
" format: Time,",
|
||||||
" base: 123,",
|
" base: 123,",
|
||||||
|
@ -205,8 +205,8 @@ mod tests {
|
||||||
" caps: None,",
|
" caps: None,",
|
||||||
" segment: Some((",
|
" segment: Some((",
|
||||||
" flags: \"\",",
|
" flags: \"\",",
|
||||||
" rate: 1,",
|
" rate: 1.0,",
|
||||||
" applied_rate: 1,",
|
" applied_rate: 1.0,",
|
||||||
" format: Time,",
|
" format: Time,",
|
||||||
" base: 0,",
|
" base: 0,",
|
||||||
" offset: 0,",
|
" offset: 0,",
|
||||||
|
|
|
@ -139,7 +139,7 @@ mod tests {
|
||||||
Ok(concat!(
|
Ok(concat!(
|
||||||
"(",
|
"(",
|
||||||
" flags: \"reset+segment\",",
|
" flags: \"reset+segment\",",
|
||||||
" rate: 1,",
|
" rate: 1.0,",
|
||||||
" applied_rate: 0.9,",
|
" applied_rate: 0.9,",
|
||||||
" format: Time,",
|
" format: Time,",
|
||||||
" base: 123,",
|
" base: 123,",
|
||||||
|
|
|
@ -199,7 +199,7 @@ mod tests {
|
||||||
r#" ("f3", "i32", 123),"#,
|
r#" ("f3", "i32", 123),"#,
|
||||||
r#" ("fraction", "Fraction", (1, 2)),"#,
|
r#" ("fraction", "Fraction", (1, 2)),"#,
|
||||||
r#" ("date", "Date", Some(YMD(2019, 8, 19))),"#,
|
r#" ("date", "Date", Some(YMD(2019, 8, 19))),"#,
|
||||||
r#" ("date_time", "DateTime", Some(YMDhmsTz(2019, 8, 19, 13, 34, 42, 2))),"#,
|
r#" ("date_time", "DateTime", Some(YMDhmsTz(2019, 8, 19, 13, 34, 42.0, 2.0))),"#,
|
||||||
r#" ("array", "Array", ["#,
|
r#" ("array", "Array", ["#,
|
||||||
r#" ("i32", 1),"#,
|
r#" ("i32", 1),"#,
|
||||||
r#" ("i32", 2),"#,
|
r#" ("i32", 2),"#,
|
||||||
|
|
|
@ -371,7 +371,7 @@ mod tests {
|
||||||
r#" 96000,"#,
|
r#" 96000,"#,
|
||||||
r#" ]),"#,
|
r#" ]),"#,
|
||||||
r#" ("replaygain-track-gain", ["#,
|
r#" ("replaygain-track-gain", ["#,
|
||||||
r#" 1,"#,
|
r#" 1.0,"#,
|
||||||
r#" ]),"#,
|
r#" ]),"#,
|
||||||
r#" ("date", ["#,
|
r#" ("date", ["#,
|
||||||
r#" YMD(2018, 5, 28),"#,
|
r#" YMD(2018, 5, 28),"#,
|
||||||
|
@ -394,8 +394,8 @@ mod tests {
|
||||||
r#" caps: None,"#,
|
r#" caps: None,"#,
|
||||||
r#" segment: Some(("#,
|
r#" segment: Some(("#,
|
||||||
r#" flags: "","#,
|
r#" flags: "","#,
|
||||||
r#" rate: 1,"#,
|
r#" rate: 1.0,"#,
|
||||||
r#" applied_rate: 1,"#,
|
r#" applied_rate: 1.0,"#,
|
||||||
r#" format: Time,"#,
|
r#" format: Time,"#,
|
||||||
r#" base: 0,"#,
|
r#" base: 0,"#,
|
||||||
r#" offset: 0,"#,
|
r#" offset: 0,"#,
|
||||||
|
@ -430,7 +430,7 @@ mod tests {
|
||||||
]),
|
]),
|
||||||
("duration", [120000000000]),
|
("duration", [120000000000]),
|
||||||
("bitrate", [96000]),
|
("bitrate", [96000]),
|
||||||
("replaygain-track-gain", [1]),
|
("replaygain-track-gain", [1.0]),
|
||||||
("date", [
|
("date", [
|
||||||
YMD(2018, 5, 28),
|
YMD(2018, 5, 28),
|
||||||
]),
|
]),
|
||||||
|
@ -491,7 +491,7 @@ mod tests {
|
||||||
["title", ["a title", "another title"]],
|
["title", ["a title", "another title"]],
|
||||||
["duration", [120000000000]],
|
["duration", [120000000000]],
|
||||||
["bitrate", [96000]],
|
["bitrate", [96000]],
|
||||||
["replaygain-track-gain", [1.0]],
|
["replaygain-track-gain", [1]],
|
||||||
["date",[{"YMD":[2018,5,28]}]],
|
["date",[{"YMD":[2018,5,28]}]],
|
||||||
["datetime",[{"YMD":[2018,5,28]}]],
|
["datetime",[{"YMD":[2018,5,28]}]],
|
||||||
["image",[{"buffer":{"pts":null,"dts":null,"duration":null,"offset":0,"offset_end":0,"flags":"","buffer":[1,2,3,4]},"buffer_list":null,"caps":null,"segment":null,"info":null}]]
|
["image",[{"buffer":{"pts":null,"dts":null,"duration":null,"offset":0,"offset_end":0,"flags":"","buffer":[1,2,3,4]},"buffer_list":null,"caps":null,"segment":null,"info":null}]]
|
||||||
|
|
Loading…
Reference in a new issue