Re-enable iterator test for Structure

This commit is contained in:
Sebastian Dröge 2017-07-12 10:38:34 +03:00
parent b44c815696
commit 49ea4e45fa
2 changed files with 13 additions and 16 deletions

View file

@ -12,7 +12,6 @@ use structure::*;
use glib; use glib;
use ffi; use ffi;
use glib::ToValue;
use glib::translate::{from_glib, from_glib_none, from_glib_full, ToGlibPtr}; use glib::translate::{from_glib, from_glib_none, from_glib_full, ToGlibPtr};
#[repr(C)] #[repr(C)]
@ -225,6 +224,7 @@ unsafe impl Send for CapsRef {}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;
use glib::ToValue;
#[test] #[test]
fn test_simple() { fn test_simple() {

View file

@ -457,27 +457,24 @@ mod tests {
assert_eq!(s.get::<i32>("f3").unwrap(), 123i32); assert_eq!(s.get::<i32>("f3").unwrap(), 123i32);
assert_eq!(s.fields().collect::<Vec<_>>(), vec!["f1", "f2", "f3"]); assert_eq!(s.fields().collect::<Vec<_>>(), vec!["f1", "f2", "f3"]);
/*
assert_eq!( let v = s.iter().map(|(f, v)| (f, v.clone())).collect::<Vec<_>>();
s.iter() assert_eq!(v.len(), 3);
.map(|(f, v)| (f, v.clone())) assert_eq!(v[0].0, "f1");
.collect::<Vec<_>>(), assert_eq!(v[0].1.get::<&str>().unwrap(), "abc");
vec![ assert_eq!(v[1].0, "f2");
("f1", "abc".into()), assert_eq!(v[1].1.get::<&str>().unwrap(), "bcd");
("f2","bcd".into()), assert_eq!(v[2].0, "f3");
("f3", 123i32.into()), assert_eq!(v[2].1.get::<i32>().unwrap(), 123i32);
]
);
let s2 = Structure::new( let s2 = Structure::new(
"test", "test",
&[ &[
("f1", "abc".into()), ("f1", &"abc".to_value()),
("f2", "bcd".into()), ("f2", &"bcd".to_value()),
("f3", 123i32.into()), ("f3", &123i32.to_value()),
], ],
); );
assert_eq!(s, s2); assert_eq!(s, s2);
*/
} }
} }