Skip to content

Commit

Permalink
Add a regression test and organize tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jseyfried committed Nov 22, 2016
1 parent 5675d9d commit 30ac06f
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 3 deletions.
File renamed without changes.
Expand Up @@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// compile-flags: -Z parse-only

// error-pattern: cannot declare a new module at this location

mod mod_file_not_owning_aux1;
Expand Down
Expand Up @@ -10,4 +10,7 @@

// ignore-test this is not a test

mod mod_file_not_owning_aux2;
macro_rules! m {
() => { mod mod_file_not_owning_aux2; }
}
m!();
15 changes: 15 additions & 0 deletions src/test/compile-fail/directory_ownership/unowned_mod_with_path.rs
@@ -0,0 +1,15 @@
// Copyright 2016 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.

// error-pattern: cannot declare a new module at this location

// This is not a directory owner since the file name is not "mod.rs".
#[path = "mod_file_not_owning_aux1.rs"]
mod foo;

0 comments on commit 30ac06f

Please sign in to comment.