From 735435bf964dcafdfc09d01ea644bbfbe725abd8 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 21 Apr 2011 16:44:17 -0700 Subject: stdlib: Add a pointer equality function to the standard library and a test case --- src/test/run-pass/lib-box.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/test/run-pass/lib-box.rs (limited to 'src/test/run-pass') diff --git a/src/test/run-pass/lib-box.rs b/src/test/run-pass/lib-box.rs new file mode 100644 index 00000000..10f5e727 --- /dev/null +++ b/src/test/run-pass/lib-box.rs @@ -0,0 +1,12 @@ +use std; +import std.Box; + +fn main() { + auto x = @3; + auto y = @3; + check (Box.ptr_eq[int](x, x)); + check (Box.ptr_eq[int](y, y)); + check (!Box.ptr_eq[int](x, y)); + check (!Box.ptr_eq[int](y, x)); +} + -- cgit v1.2.3