]> git.lizzy.rs Git - rust.git/commitdiff
Added tests for default generation of package_id meta attribute
authorAndrei Formiga <archimedes_siracusa@hotmail.com>
Fri, 8 Nov 2013 19:53:04 +0000 (16:53 -0300)
committerAndrei Formiga <archimedes_siracusa@hotmail.com>
Fri, 8 Nov 2013 20:42:46 +0000 (17:42 -0300)
src/test/auxiliary/crateresolve8-1.rs [new file with mode: 0644]
src/test/run-pass/crateresolve8.rs [new file with mode: 0644]

diff --git a/src/test/auxiliary/crateresolve8-1.rs b/src/test/auxiliary/crateresolve8-1.rs
new file mode 100644 (file)
index 0000000..22ccde0
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// default link meta for 'package_id' will be equal to filestem
+#[link(name = "crateresolve8",
+       vers = "0.1")];
+
+#[crate_type = "lib"];
+
+pub fn f() -> int { 20 }
diff --git a/src/test/run-pass/crateresolve8.rs b/src/test/run-pass/crateresolve8.rs
new file mode 100644 (file)
index 0000000..8ade79a
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// xfail-fast
+// aux-build:crateresolve8-1.rs
+
+extern mod crateresolve8(vers = "0.1", package_id="crateresolve8");
+//extern mod crateresolve8(vers = "0.1");
+
+pub fn main() {
+    assert_eq!(crateresolve8::f(), 20);
+}