diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2012-06-19 20:52:33 -0700 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-06-19 20:52:33 -0700 |
| commit | de491ea7078b143c4eee30e912db06a0742488d2 (patch) | |
| tree | a0b0e66f694fabc1240c0f7d356030c19eda4dc7 /src | |
| parent | 773a640303db0995868f8739857b0df16afa1969 (diff) | |
| download | rust-de491ea7078b143c4eee30e912db06a0742488d2.tar.gz rust-de491ea7078b143c4eee30e912db06a0742488d2.zip | |
two more tests for method autoderef
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/run-pass/autoderef-method-twice-but-not-thrice.rs | 8 | ||||
| -rw-r--r-- | src/test/run-pass/autoderef-method-twice.rs | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs b/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs new file mode 100644 index 00000000000..4c15661e8f0 --- /dev/null +++ b/src/test/run-pass/autoderef-method-twice-but-not-thrice.rs @@ -0,0 +1,8 @@ +impl methods for @@uint { + fn double() -> uint { **self * 2u } +} + +fn main() { + let x = @@@@@3u; + assert x.double() == 6u; +} diff --git a/src/test/run-pass/autoderef-method-twice.rs b/src/test/run-pass/autoderef-method-twice.rs new file mode 100644 index 00000000000..3587e1d83a1 --- /dev/null +++ b/src/test/run-pass/autoderef-method-twice.rs @@ -0,0 +1,8 @@ +impl methods for uint { + fn double() -> uint { self * 2u } +} + +fn main() { + let x = @@3u; + assert x.double() == 6u; +} |
