Commit 49ea4e45 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Re-enable iterator test for Structure

parent b44c8156
......@@ -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};
......@@ -225,6 +224,7 @@ unsafe impl Send for CapsRef {}
mod tests {
use super::*;
use glib::ToValue;
fn test_simple() {
......@@ -457,27 +457,24 @@ mod tests {
assert_eq!(s.get::<i32>("f3").unwrap(), 123i32);
assert_eq!(s.fields().collect::<Vec<_>>(), vec!["f1", "f2", "f3"]);
.map(|(f, v)| (f, v.clone()))
("f1", "abc".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(
("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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment