1 // Test const functions in the library
3 pub const MY_VEC: Vec<usize> = Vec::new();
4 pub const MY_VEC2: Vec<usize> = Default::default();
6 pub const MY_STRING: String = String::new();
7 pub const MY_STRING2: String = Default::default();
9 use std::collections::{BTreeMap, BTreeSet};
11 pub const MY_BTREEMAP: BTreeMap<usize, usize> = BTreeMap::new();
12 pub const MAP: &'static BTreeMap<usize, usize> = &MY_BTREEMAP;
13 pub const MAP_LEN: usize = MAP.len();
14 pub const MAP_IS_EMPTY: bool = MAP.is_empty();
16 pub const MY_BTREESET: BTreeSet<usize> = BTreeSet::new();
17 pub const SET: &'static BTreeSet<usize> = &MY_BTREESET;
18 pub const SET_LEN: usize = SET.len();
19 pub const SET_IS_EMPTY: bool = SET.is_empty();
23 assert_eq!(MY_VEC, MY_VEC2);
24 assert_eq!(MY_STRING, MY_STRING2);
26 assert_eq!(MAP_LEN, 0);
27 assert_eq!(SET_LEN, 0);
28 assert!(MAP_IS_EMPTY && SET_IS_EMPTY);