Sha256: 16ac749c783bffbc73fb402808d2c500eab554bc27fdcd1e3fcb935801e1689b
Contents?: true
Size: 665 Bytes
Versions: 19
Compression:
Stored size: 665 Bytes
Contents
use magnus::{eval, RArray}; #[test] fn enumerator_impls_iterator() { let _cleanup = unsafe { magnus::embed::init() }; let a: RArray = eval("[1,2,3]").unwrap(); let mut e = a.each(); assert_eq!( e.next() .unwrap() .and_then(|v| v.try_convert::<i64>()) .unwrap(), 1 ); assert_eq!( e.next() .unwrap() .and_then(|v| v.try_convert::<i64>()) .unwrap(), 2 ); assert_eq!( e.next() .unwrap() .and_then(|v| v.try_convert::<i64>()) .unwrap(), 3 ); assert!(e.next().is_none()); }
Version data entries
19 entries across 19 versions & 1 rubygems