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

View file

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