Skip to content

Commit 4f4afaa

Browse files
author
Lenny222
committed
---
yaml --- r: 7011 b: refs/heads/master c: ab2a643 h: refs/heads/master i: 7009: 61e6396 7007: 38503e6 v: v3
1 parent 32f42c7 commit 4f4afaa

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: d07c6e8a0ede3114ebfd8c3ea6cc161cf009f072
2+
refs/heads/master: ab2a643f278d09c3fcc140ecb4c7cecbf1aff3c4

trunk/src/test/stdtest/list.rs

+16-1
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,24 @@ import core::*;
22

33
use std;
44
import std::list;
5-
import std::list::{from_vec, head, is_not_empty, tail};
5+
import std::list::{from_vec, head, is_empty, is_not_empty, tail};
66
import option;
77

8+
#[test]
9+
fn test_is_empty() {
10+
let empty : list::list<int> = from_vec([]);
11+
let full1 = from_vec([1]);
12+
let full2 = from_vec(['r', 'u']);
13+
14+
assert is_empty(empty);
15+
assert !is_empty(full1);
16+
assert !is_empty(full2);
17+
18+
assert !is_not_empty(empty);
19+
assert is_not_empty(full1);
20+
assert is_not_empty(full2);
21+
}
22+
823
#[test]
924
fn test_from_vec() {
1025
let l = from_vec([0, 1, 2]);

0 commit comments

Comments
 (0)