2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2012-03-07 17:13:31 -06:00
|
|
|
// aux-build:cci_nested_lib.rs
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2014-02-14 12:10:06 -06:00
|
|
|
extern crate cci_nested_lib;
|
2012-09-05 14:32:05 -05:00
|
|
|
use cci_nested_lib::*;
|
2012-03-07 17:13:31 -06:00
|
|
|
|
2013-01-30 17:56:40 -06:00
|
|
|
pub fn main() {
|
2012-03-07 17:13:31 -06:00
|
|
|
let lst = new_int_alist();
|
2014-05-25 05:10:11 -05:00
|
|
|
alist_add(&lst, 22, "hi".to_string());
|
|
|
|
alist_add(&lst, 44, "ho".to_string());
|
|
|
|
assert_eq!(alist_get(&lst, 22), "hi".to_string());
|
|
|
|
assert_eq!(alist_get(&lst, 44), "ho".to_string());
|
2012-03-07 17:13:31 -06:00
|
|
|
|
|
|
|
let lst = new_int_alist_2();
|
2014-05-25 05:10:11 -05:00
|
|
|
alist_add(&lst, 22, "hi".to_string());
|
|
|
|
alist_add(&lst, 44, "ho".to_string());
|
|
|
|
assert_eq!(alist_get(&lst, 22), "hi".to_string());
|
|
|
|
assert_eq!(alist_get(&lst, 44), "ho".to_string());
|
2012-03-07 17:13:31 -06:00
|
|
|
}
|