about summary refs log tree commit diff
path: root/tests/run-make/output-with-hyphens/rmake.rs
blob: 79deb772bc5df6b581c09a1a39034928e87d531e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Rust files with hyphens in their filename should
// not result in compiled libraries keeping that hyphen -
// it should become an underscore. Only bin executables
// should keep the hyphen. This test ensures that this rule
// remains enforced.
// See https://github.com/rust-lang/rust/pull/23786

//@ ignore-cross-compile

use run_make_support::{bin_name, path, rust_lib_name, rustc};

fn main() {
    rustc().input("foo-bar.rs").crate_type("bin").run();
    assert!(path(bin_name("foo-bar")).exists());
    rustc().input("foo-bar.rs").crate_type("lib").run();
    assert!(path(rust_lib_name("foo_bar")).exists());
}