mod shared; use data_stream::default_settings::{NativeSettings, PortableSettings}; use shared::assert_streamed_eq; use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, LinkedList, VecDeque}; macro_rules! impl_test { ($name: ident, $t: ty, $settings: ty) => { #[test] fn $name() { assert_streamed_eq::<$settings, $t>(&vec![1, 2, 3, 4, 5].into_iter().collect()); } }; } macro_rules! impl_map_test { ($name: ident, $t: ty, $settings: ty) => { #[test] fn $name() { assert_streamed_eq::<$settings, $t>( &vec![(1, 1.0), (2, 2.0), (3, 3.0), (4, 4.0), (5, 5.0)] .into_iter() .collect(), ); } }; } impl_test!(check_vec_native, Vec, NativeSettings); impl_test!(check_vec_portable, Vec, PortableSettings); impl_test!(check_vec_deque_native, VecDeque, NativeSettings); impl_test!(check_vec_deque_portable, VecDeque, PortableSettings); impl_test!(check_linked_list_native, LinkedList, NativeSettings); impl_test!( check_linked_list_portable, LinkedList, PortableSettings ); impl_test!(check_hash_set_native, HashSet, NativeSettings); impl_test!(check_hash_set_portable, HashSet, PortableSettings); impl_test!(check_binary_tree_set_native, BTreeSet, NativeSettings); impl_test!( check_binary_tree_set_portable, BTreeSet, PortableSettings ); impl_map_test!(check_hash_map_native, HashMap, NativeSettings); impl_map_test!(check_hash_map_portable, HashMap, PortableSettings); impl_map_test!(check_binary_tree_map_native, BTreeMap, NativeSettings); impl_map_test!( check_binary_tree_map_portable, BTreeMap, PortableSettings );