Skip to content

Commit 23387b0

Browse files
committed
Added tests for default generation of package_id meta attribute
1 parent cf24280 commit 23387b0

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/test/auxiliary/crateresolve8-1.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// default link meta for 'package_id' will be equal to filestem
12+
#[link(name = "crateresolve8",
13+
vers = "0.1")];
14+
15+
#[crate_type = "lib"];
16+
17+
pub fn f() -> int { 20 }

src/test/run-pass/crateresolve8.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// xfail-fast
12+
// aux-build:crateresolve8-1.rs
13+
14+
extern mod crateresolve8(vers = "0.1", package_id="crateresolve8");
15+
//extern mod crateresolve8(vers = "0.1");
16+
17+
pub fn main() {
18+
assert_eq!(crateresolve8::f(), 20);
19+
}

0 commit comments

Comments
 (0)