]> git.lizzy.rs Git - rust.git/commitdiff
Restore some functionality that got stripped out of the export tests while last refor...
authorGraydon Hoare <graydon@mozilla.com>
Thu, 30 Jun 2011 22:19:47 +0000 (15:19 -0700)
committerGraydon Hoare <graydon@mozilla.com>
Thu, 30 Jun 2011 22:39:25 +0000 (15:39 -0700)
src/test/run-pass/export-abstract-tag.rs
src/test/run-pass/export-non-interference2.rs
src/test/run-pass/export-non-interference3.rs
src/test/run-pass/export-tag-variant.rs
src/test/run-pass/export-unexported-dep.rs

index 805c14f8cd08a6f61366b7110d828896c110a013..7e488631051a04f62a323721e5c09f1282dfac10 100644 (file)
@@ -1,11 +1,19 @@
-
-
-
 // We can export tags without exporting the variants to create a simple
 // sort of ADT.
+
 mod foo {
-    tag t { t1; }
-    fn f() -> t { ret t1; }
+  export t;
+  export f;
+
+  tag t {
+    t1;
+  }
+
+  fn f() -> t {
+    ret t1;
+  }
 }
 
-fn main() { let foo::t v = foo::f(); }
\ No newline at end of file
+fn main() {
+  let foo::t v = foo::f();
+}
index af539923a9e1f45706eda8783484143c02a95755..533df528043c8efddd7eabb4c939d8670b7ea77a 100644 (file)
@@ -1,10 +1,18 @@
+mod foo {
 
+  export bar;
 
-mod foo {
-    mod bar {
-        fn y() { x(); }
+  mod bar {
+    fn y() {
+      x();
     }
-    fn x() { log "x"; }
+  }
+
+  fn x() {
+    log "x";
+  }
 }
 
-fn main() { foo::bar::y(); }
\ No newline at end of file
+fn main() {
+  foo::bar::y();
+}
index e06112b0d93fac99ea2efe312051706700a49936..7b936b63e1150187f98794512d68687e83415d54 100644 (file)
@@ -1,11 +1,19 @@
-
-
 mod foo {
-    fn x() { bar::x(); }
+  export x;
+
+  fn x() {
+    bar::x();
+  }
 }
 
 mod bar {
-    fn x() { log "x"; }
+  export x;
+
+  fn x() {
+    log "x";
+  }
 }
 
-fn main() { foo::x(); }
\ No newline at end of file
+fn main() {
+  foo::x();
+}
index 22e5c5b6aeabe6857a7dfda0975f47a02a12645a..309261a50d5ebb887d3da3862350da8ce571d02e 100644 (file)
@@ -1,9 +1,12 @@
-
-
-
 // Export the tag variants, without the tag
+
 mod foo {
-    tag t { t1; }
+  export t1;
+  tag t {
+    t1;
+  }
 }
 
-fn main() { auto v = foo::t1; }
\ No newline at end of file
+fn main() {
+  auto v = foo::t1;
+}
index 01b8059bf7a5304ab81ed0187660f2ec011e791e..dcb88af2f73d42c80db0c25bbdbcc972aa69136c 100644 (file)
@@ -1,14 +1,24 @@
-
-
-
 // This tests that exports can have visible dependencies on things
 // that are not exported, allowing for a sort of poor-man's ADT
+
 mod foo {
+  export f;
+  export g;
+
+  // not exported
+  tag t {
+    t1;
+  }
+
+  fn f() -> t {
+    ret t1;
+  }
 
-    // not exported
-    tag t { t1; }
-    fn f() -> t { ret t1; }
-    fn g(t v) { assert (v == t1); }
+  fn g(t v) {
+    assert v == t1;
+  }
 }
 
-fn main() { foo::g(foo::f()); }
\ No newline at end of file
+fn main() {
+  foo::g(foo::f());
+}
\ No newline at end of file