From 23387b062deddc8ca44fcbde834b7ab0f4e6d832 Mon Sep 17 00:00:00 2001 From: Andrei Formiga Date: Fri, 8 Nov 2013 16:53:04 -0300 Subject: [PATCH] Added tests for default generation of package_id meta attribute --- src/test/auxiliary/crateresolve8-1.rs | 17 +++++++++++++++++ src/test/run-pass/crateresolve8.rs | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/test/auxiliary/crateresolve8-1.rs create mode 100644 src/test/run-pass/crateresolve8.rs diff --git a/src/test/auxiliary/crateresolve8-1.rs b/src/test/auxiliary/crateresolve8-1.rs new file mode 100644 index 000000000000..22ccde01c4af --- /dev/null +++ b/src/test/auxiliary/crateresolve8-1.rs @@ -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 or the MIT license +// , 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 index 000000000000..8ade79a4a84a --- /dev/null +++ b/src/test/run-pass/crateresolve8.rs @@ -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 or the MIT license +// , 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); +}