about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMurarth <murarth@gmail.com>2014-11-23 22:24:38 -0700
committerMurarth <murarth@gmail.com>2014-11-24 10:07:19 -0700
commit6a5fc50782905cede94ae9bdaa04e3b07347c4be (patch)
tree44b371eeb89860d4bdc2cfdaa5c78aef7fe68640
parenta95c71e0ac3dc97468d7432d5011fbb413ba9263 (diff)
downloadrust-6a5fc50782905cede94ae9bdaa04e3b07347c4be.tar.gz
rust-6a5fc50782905cede94ae9bdaa04e3b07347c4be.zip
Added test for module_path! fix
-rw-r--r--src/test/run-pass/issue-18859.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-18859.rs b/src/test/run-pass/issue-18859.rs
new file mode 100644
index 00000000000..490f7eb6bea
--- /dev/null
+++ b/src/test/run-pass/issue-18859.rs
@@ -0,0 +1,24 @@
+// Copyright 2014 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.
+
+mod foo {
+    pub mod bar {
+        pub mod baz {
+            pub fn name() -> &'static str {
+                module_path!()
+            }
+        }
+    }
+}
+
+fn main() {
+    assert_eq!(module_path!(), "issue-18859");
+    assert_eq!(foo::bar::baz::name(), "issue-18859::foo::bar::baz");
+}