Reformat source tree (minus a couple tests that are still grumpy).
This commit is contained in:
parent
8d381823e2
commit
ce72993488
379 changed files with 13643 additions and 18907 deletions
|
@ -1,34 +1,18 @@
|
|||
|
||||
|
||||
|
||||
// -*- rust -*-
|
||||
|
||||
// Tests for alt as expressions resulting in structural types
|
||||
|
||||
fn test_rec() {
|
||||
auto res = alt (true) {
|
||||
case (true) {
|
||||
rec(i = 100)
|
||||
}
|
||||
};
|
||||
assert (res == rec(i = 100));
|
||||
auto res = alt (true) { case (true) { rec(i=100) } };
|
||||
assert (res == rec(i=100));
|
||||
}
|
||||
|
||||
fn test_tag() {
|
||||
tag mood {
|
||||
happy;
|
||||
sad;
|
||||
}
|
||||
|
||||
auto res = alt (true) {
|
||||
case (true) {
|
||||
happy
|
||||
}
|
||||
case (false) {
|
||||
sad
|
||||
}
|
||||
};
|
||||
assert (res == happy);
|
||||
tag mood { happy; sad; }
|
||||
auto res = alt (true) { case (true) { happy } case (false) { sad } };
|
||||
assert (res == happy);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
test_rec();
|
||||
test_tag();
|
||||
}
|
||||
fn main() { test_rec(); test_tag(); }
|
Loading…
Add table
Add a link
Reference in a new issue