about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-01-03 12:19:13 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2017-04-24 15:16:52 +0200
commitbd880bc6bf62a223664467d4df2b056a9122b7e7 (patch)
treec5726dc2eb311f9734968b62617c21bd577910df /src/test
parente4825290223f39647bf2782b9d4ef5f00554c7ee (diff)
Add tests for module suggestions
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/auxiliary/foo/bar.rs11
-rw-r--r--src/test/compile-fail/auxiliary/foo/mod.rs11
-rw-r--r--src/test/compile-fail/invalid-module-declaration.rs20
3 files changed, 42 insertions, 0 deletions
diff --git a/src/test/compile-fail/auxiliary/foo/bar.rs b/src/test/compile-fail/auxiliary/foo/bar.rs
new file mode 100644
index 00000000000..4b6b4f5ebf8
--- /dev/null
+++ b/src/test/compile-fail/auxiliary/foo/bar.rs
@@ -0,0 +1,11 @@
+// Copyright 2017 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.
+
+pub mod baz;
diff --git a/src/test/compile-fail/auxiliary/foo/mod.rs b/src/test/compile-fail/auxiliary/foo/mod.rs
new file mode 100644
index 00000000000..6d77fb60a35
--- /dev/null
+++ b/src/test/compile-fail/auxiliary/foo/mod.rs
@@ -0,0 +1,11 @@
+// Copyright 2017 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.
+
+pub mod bar;
diff --git a/src/test/compile-fail/invalid-module-declaration.rs b/src/test/compile-fail/invalid-module-declaration.rs
new file mode 100644
index 00000000000..658fa0a65c4
--- /dev/null
+++ b/src/test/compile-fail/invalid-module-declaration.rs
@@ -0,0 +1,20 @@
+// 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.
+
+// ignore-tidy-linelength
+
+// error-pattern: cannot declare a new module at this location
+// error-pattern: maybe move this module `src/test/compile-fail/auxiliary/foo/bar.rs` to its own directory via `src/test/compile-fail/auxiliary/foo/bar/mod.rs`
+
+mod auxiliary {
+    mod foo;
+}
+
+fn main() {}