mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 02:57:38 +00:00
servo: add a rather silly second test
Source-Repo: https://github.com/servo/servo Source-Revision: 4a9f4c410eb59355c333ffc46717a2883bcf127b
This commit is contained in:
parent
b98c0e9eff
commit
448e69cc86
@ -77,8 +77,7 @@ mod test {
|
||||
dummy(@{fields: empty(), value: v})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn add_child_0() {
|
||||
fn parent_with_3_children() -> {p: dummy, children: [dummy]} {
|
||||
let children = [new_dummy(0u),
|
||||
new_dummy(1u),
|
||||
new_dummy(2u)];
|
||||
@ -88,6 +87,12 @@ mod test {
|
||||
add_child(p, c);
|
||||
}
|
||||
|
||||
ret {p: p, children: children};
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn add_child_0() {
|
||||
let {p, children} = parent_with_3_children();
|
||||
let mut i = 0u;
|
||||
for each_child(p) {|c|
|
||||
assert c.value == i;
|
||||
@ -95,4 +100,15 @@ mod test {
|
||||
}
|
||||
assert i == children.len();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn add_child_break() {
|
||||
let {p, _} = parent_with_3_children();
|
||||
let mut i = 0u;
|
||||
for each_child(p) {|_c|
|
||||
i += 1u;
|
||||
break;
|
||||
}
|
||||
assert i == 1u;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user