2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2012-03-07 23:13:31 +00:00
|
|
|
//@ aux-build:cci_nested_lib.rs
|
|
|
|
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2014-02-14 18:10:06 +00:00
|
|
|
extern crate cci_nested_lib;
|
2012-09-05 19:32:05 +00:00
|
|
|
use cci_nested_lib::*;
|
2012-03-07 23:13:31 +00:00
|
|
|
|
2013-01-30 23:56:40 +00:00
|
|
|
pub fn main() {
|
2012-03-07 23:13:31 +00:00
|
|
|
let lst = new_int_alist();
|
2014-05-25 10:10:11 +00: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 23:13:31 +00:00
|
|
|
|
|
|
|
let lst = new_int_alist_2();
|
2014-05-25 10:10:11 +00: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 23:13:31 +00:00
|
|
|
}
|