Skip to content

Commit

Permalink
tests: make lots of main functions public
Browse files Browse the repository at this point in the history
  • Loading branch information
Blei committed Jun 8, 2013
1 parent af0a872 commit b6e2617
Show file tree
Hide file tree
Showing 69 changed files with 69 additions and 69 deletions.
2 changes: 1 addition & 1 deletion src/test/run-pass/borrowck-nested-calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Foo {
}
}

fn main() {
pub fn main() {
let mut f = Foo {a: 22, b: 23};
f.inc_a(f.next_b());
assert_eq!(f.a, 22+23);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/borrowck-unary-move-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn noncopyable() -> noncopyable {

struct wrapper(noncopyable);

fn main() {
pub fn main() {
let x1 = wrapper(noncopyable());
let _x2 = *x1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// run-fail/borrowck-wg-autoderef-and-autoborrowvec-combined-fail-issue-6272.rs


fn main() {
pub fn main() {
let a = @mut [3i];
let b = @mut [a];
let c = @mut b;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/cast-mutable-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn bar(t: @mut T) {
t.foo();
}

fn main() {
pub fn main() {
let s = @mut S { unused: 0 };
let s2 = s as @mut T;
s2.foo();
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/cfgs-on-items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn foo2() -> int { 2 }
fn foo2() -> int { 3 }


fn main() {
pub fn main() {
assert_eq!(1, foo1());
assert_eq!(3, foo2());
}
2 changes: 1 addition & 1 deletion src/test/run-pass/cond-macro-no-default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn clamp<T:Copy + Ord + Signed>(x: T, mn: T, mx: T) -> T {
return x;
}

fn main() {
pub fn main() {
assert_eq!(clamp(1, 2, 4), 2);
assert_eq!(clamp(8, 2, 4), 4);
assert_eq!(clamp(3, 2, 4), 3);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/cond-macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn clamp<T:Copy + Ord + Signed>(x: T, mn: T, mx: T) -> T {
)
}

fn main() {
pub fn main() {
assert_eq!(clamp(1, 2, 4), 2);
assert_eq!(clamp(8, 2, 4), 4);
assert_eq!(clamp(3, 2, 4), 3);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/const-binops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static am: bool = 2 > 1;
static an: bool = 2 > -2;
static ao: bool = 1.0 > -2.0;

fn main() {
pub fn main() {
assert_eq!(a, -1);
assert_eq!(a2, 6);
assert_approx_eq!(b, 5.7);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/const-cross-crate-const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static foo: &'static str = cci_const::foopy;
static a: uint = cci_const::uint_val;
static b: uint = cci_const::uint_expr + 5;

fn main() {
pub fn main() {
assert_eq!(a, 12);
let foo2 = a;
assert_eq!(foo2, cci_const::uint_val);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/const-struct-offsets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ struct Bar {

static bar: Bar = Bar { i: 0, v: IntVal(0) };

fn main() {}
pub fn main() {}

2 changes: 1 addition & 1 deletion src/test/run-pass/cross-crate-const-pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

extern mod cci_const;

fn main() {
pub fn main() {
let x = cci_const::uint_val;
match x {
cci_const::uint_val => {}
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/cross-crate-newtype-struct-pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

extern mod newtype_struct_xc;

fn main() {
pub fn main() {
let x = newtype_struct_xc::Au(21);
match x {
newtype_struct_xc::Au(n) => assert_eq!(n, 21)
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/deriving-clone-generic-enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ enum E<T,U> {
C
}

fn main() {
pub fn main() {
let _ = A::<int, int>(1i).clone();
let _ = B(1i, 1.234).deep_clone();
}
2 changes: 1 addition & 1 deletion src/test/run-pass/deriving-clone-generic-tuple-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
#[deriving(Clone, DeepClone)]
struct S<T>(T, ());

fn main() {
pub fn main() {
let _ = S(1i, ()).clone().deep_clone();
}
2 changes: 1 addition & 1 deletion src/test/run-pass/deriving-clone-struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ struct S {
_nil: ()
}

fn main() {}
pub fn main() {}
2 changes: 1 addition & 1 deletion src/test/run-pass/deriving-rand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ enum D {
D2 { x: (), y: () }
}

fn main() {
pub fn main() {
// check there's no segfaults
for 20.times {
rand::random::<A>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct A<'self> {
x: &'self int
}

fn main() {
pub fn main() {
let a = A { x: &1 }, b = A { x: &2 };

assert!(a.equals(&a));
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/deriving-self-lifetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct A<'self> {
x: &'self int
}

fn main() {
pub fn main() {
let a = A { x: &1 };
let b = A { x: &2 };

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/deriving-to-str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ enum D {
D2 { x: (), y: () }
}

fn main() {
pub fn main() {
macro_rules! t(
($ty:ty) => {{
let x =rand::random::<$ty>();
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/dupe-first-attr.rc
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ mod hello;
#[cfg(target_os = "android")]
mod hello;

fn main() { }
pub fn main() { }
2 changes: 1 addition & 1 deletion src/test/run-pass/expr-repeat-vstore.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::io::println;

fn main() {
pub fn main() {
let v: ~[int] = ~[ 1, ..5 ];
println(v[0].to_str());
println(v[1].to_str());
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-mod-ordering-exe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ extern mod extern_mod_ordering_lib;

use extern_mod_ordering_lib::extern_mod_ordering_lib;

fn main() {
pub fn main() {
extern_mod_ordering_lib::f();
}
2 changes: 1 addition & 1 deletion src/test/run-pass/extern-mod-url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
// xfail-test
extern mod test = "github.com/catamorphism/test-pkg";

fn main() {}
pub fn main() {}
2 changes: 1 addition & 1 deletion src/test/run-pass/filter-block-view-items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn main() {
pub fn main() {
// Make sure that this view item is filtered out because otherwise it would
// trigger a compilation error
#[cfg(not_present)] use foo = bar;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-2611-3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ impl A for E {
fn b<F:Copy,G>(_x: F) -> F { fail!() } //~ ERROR in method `b`, type parameter 0 has 1 bound, but
}

fn main() {}
pub fn main() {}
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-3290.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// except according to those terms.

// xfail-test
fn main() {
pub fn main() {
let mut x = ~3;
x = x;
assert_eq!(*x, 3);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-3796.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

// xfail-test
#[deny(dead_assignment)];
fn main() {
pub fn main() {
let mut x = 1;
let f: &fn() -> int = || { x + 20 };
assert_eq!(f(), 21);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-3907-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl Foo for S {
fn bar() { }
}

fn main() {
pub fn main() {
let s = S {
name: 0
};
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-4241.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,5 @@ fn query2(cmd: ~[~str]) -> Result {
}


fn main() {
pub fn main() {
}
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-4252.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<T: X> Drop for Z<T> {
}
}

fn main() {
pub fn main() {
let y = Y;
let _z = Z{x: y};
}
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-4325.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ impl<'self, T> Node<'self, T> {
}
}

fn main() {}
pub fn main() {}
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-4333.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use std::io;

fn main() {
pub fn main() {
let stdout = &io::stdout() as &io::WriterUtil;
stdout.write_line("Hello!");
}
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-4735.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl Drop for NonCopyable {
}
}

fn main() {
pub fn main() {
let t = ~0;
let p = unsafe { transmute::<~int, *c_void>(t) };
let z = NonCopyable(p);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-5315.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// xfail-test
struct A(bool);

fn main() {
pub fn main() {
let f = A;
f(true);
}
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-5353.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ fn gl_err_str(err: u32) -> ~str
}
}

fn main() {}
pub fn main() {}
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-5517.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn main() {
pub fn main() {
let box1 = @mut 42;
let _x = *(&mut *box1) == 42 || *(&mut *box1) == 31337;
}
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-5550.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

fn main() {
pub fn main() {
let s: ~str = ~"foobar";
let mut t: &str = s;
t = t.slice(0, 3); // for master: str::view(t, 0, 3) maybe
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-5572.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fn foo<T: ::std::cmp::Eq>(t: T) { }

fn main() { }
pub fn main() { }
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-5741.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use std::io;

fn main() {
pub fn main() {
return;
while io::stdin().read_line() != ~"quit" { };
}
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-6130.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#[deny(type_limits)];

fn main() {
pub fn main() {
let i: uint = 0;
assert!(i <= 0xFFFF_FFFF_u);

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-6141-leaking-owned-fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ fn run(f: &fn()) {
f()
}

fn main() {
pub fn main() {
let f: ~fn() = || ();
run(f);
}
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-6341.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ impl Drop for A {
fn finalize(&self) {}
}

fn main() {}
pub fn main() {}
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-6344-let.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl Drop for A {
fn finalize(&self) {}
}

fn main() {
pub fn main() {
let a = A { x: 0 };

let A { x: ref x } = a;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-6344-match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl Drop for A {
fn finalize(&self) {}
}

fn main() {
pub fn main() {
let a = A { x: 0 };

match a {
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/match-range-static.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
static s: int = 1;
static e: int = 42;

fn main() {
pub fn main() {
match 7 {
s..e => (),
_ => (),
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/match-vec-rvalue.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Tests that matching rvalues with drops does not crash.

fn main() {
pub fn main() {
match ~[1, 2, 3] {
x => {
assert_eq!(x.len(), 3);
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/move-out-of-field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn to_str(sb: StringBuffer) -> ~str {
sb.s
}

fn main() {
pub fn main() {
let mut sb = StringBuffer {s: ~""};
sb.append("Hello, ");
sb.append("World!");
Expand Down
Loading

4 comments on commit b6e2617

@bors
Copy link
Contributor

@bors bors commented on b6e2617 Jun 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on b6e2617 Jun 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging Blei/rust/remove-export-all = b6e2617 into auto

@bors
Copy link
Contributor

@bors bors commented on b6e2617 Jun 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blei/rust/remove-export-all = b6e2617 merged ok, testing candidate = 63d3790f

@bors
Copy link
Contributor

@bors bors commented on b6e2617 Jun 10, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.