Skip to content

Commit

Permalink
Test case for issue #435.
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuper committed Jul 28, 2011
1 parent 0268cb7 commit c15871a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/test/run-pass/standalone-method.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//xfail-stage0
//xfail-stage1
//xfail-stage2
//xfail-stage3

// Test case for issue #435.
obj foo() {
fn add5(n: int) -> int {
ret n + 5;
}
}

fn add5(n: int) -> int {
ret n + 5;
}

fn main() {
let fiveplusseven = bind add5(7);
assert add5(7) == 12;
assert fiveplusseven() == 12;

let my_foo = foo();
let fiveplusseven_too = bind my_foo.add5(7);
assert my_foo.add5(7) == 12;
assert fiveplusseven_too() == 12;
}

0 comments on commit c15871a

Please sign in to comment.