diff options
| author | Lenny222 <github@kudling.de> | 2011-12-30 10:54:31 +0100 |
|---|---|---|
| committer | Lenny222 <github@kudling.de> | 2011-12-30 10:54:31 +0100 |
| commit | ab2a643f278d09c3fcc140ecb4c7cecbf1aff3c4 (patch) | |
| tree | 4346135b40bb4581acae084ad358d7a43cc2badb /src/test/stdtest | |
| parent | d07c6e8a0ede3114ebfd8c3ea6cc161cf009f072 (diff) | |
| download | rust-ab2a643f278d09c3fcc140ecb4c7cecbf1aff3c4.tar.gz rust-ab2a643f278d09c3fcc140ecb4c7cecbf1aff3c4.zip | |
add test for list:is_empty()
Diffstat (limited to 'src/test/stdtest')
| -rw-r--r-- | src/test/stdtest/list.rs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/test/stdtest/list.rs b/src/test/stdtest/list.rs index d88e669378a..b96bc9cd16a 100644 --- a/src/test/stdtest/list.rs +++ b/src/test/stdtest/list.rs @@ -2,10 +2,25 @@ import core::*; use std; import std::list; -import std::list::{from_vec, head, is_not_empty, tail}; +import std::list::{from_vec, head, is_empty, is_not_empty, tail}; import option; #[test] +fn test_is_empty() { + let empty : list::list<int> = from_vec([]); + let full1 = from_vec([1]); + let full2 = from_vec(['r', 'u']); + + assert is_empty(empty); + assert !is_empty(full1); + assert !is_empty(full2); + + assert !is_not_empty(empty); + assert is_not_empty(full1); + assert is_not_empty(full2); +} + +#[test] fn test_from_vec() { let l = from_vec([0, 1, 2]); |
