Skip to content

Commit fad0559

Browse files
committed
testsuite: more pub fn main
1 parent e23fad0 commit fad0559

25 files changed

+126
-26
lines changed

src/test/run-pass/assert-eq-macro-success.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
#[deriving(Eq)]
212
struct Point { x : int }
313

4-
fn main() {
14+
pub fn main() {
515
assert_eq!(14,14);
616
assert_eq!(~"abc",~"abc");
717
assert_eq!(~Point{x:34},~Point{x:34});

src/test/run-pass/const-cast-ptr-int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
static a: *u8 = 0 as *u8;
1212

13-
fn main() {
13+
pub fn main() {
1414
fail_unless!(a == ptr::null());
1515
}

src/test/run-pass/const-cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static y: *libc::c_void = x as *libc::c_void;
1515
static a: &'static int = &10;
1616
static b: *int = a as *int;
1717

18-
fn main() {
18+
pub fn main() {
1919
fail_unless!(x as *libc::c_void == y);
2020
fail_unless!(a as *int == b);
2121
}

src/test/run-pass/const-cross-crate-extern.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ extern mod cci_const;
1515
use cci_const::bar;
1616
static foo: *u8 = bar;
1717

18-
fn main() {
18+
pub fn main() {
1919
fail_unless!(foo == cci_const::bar);
2020
}

src/test/run-pass/const-enum-cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
enum A { A1, A2 }
1212
enum B { B1=0, B2=2 }
1313

14-
fn main () {
14+
pub fn main () {
1515
static c1: int = A2 as int;
1616
static c2: int = B2 as int;
1717
static c3: float = A2 as float;

src/test/run-pass/const-enum-structlike.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ enum E {
1515

1616
static C: E = S1 { u: 23 };
1717

18-
fn main() {
18+
pub fn main() {
1919
match C {
2020
S0 { _ } => fail!(),
2121
S1 { u } => fail_unless!(u == 23)

src/test/run-pass/const-expr-in-fixed-length-vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Check that constant expressions can be used for declaring the
1212
// type of a fixed length vector.
1313

14-
fn main() {
14+
pub fn main() {
1515

1616
static FOO: int = 2;
1717
let _v: [int, ..FOO*3];

src/test/run-pass/const-expr-in-vec-repeat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Check that constant expressions can be used in vec repeat syntax.
1212

13-
fn main() {
13+
pub fn main() {
1414

1515
static FOO: int = 2;
1616
let _v = [0, ..FOO*3*2/2];

src/test/run-pass/const-str-ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ static a: [u8, ..3] = ['h' as u8, 'i' as u8, 0 as u8];
1212
static c: &'static [u8, ..3] = &a;
1313
static b: *u8 = c as *u8;
1414

15-
fn main() {
15+
pub fn main() {
1616
let foo = &a as *u8;
1717
fail_unless!(unsafe { str::raw::from_bytes(a) } == ~"hi\x00");
1818
fail_unless!(unsafe { str::raw::from_buf(foo) } == ~"hi");

src/test/run-pass/const-vec-syntax.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
fn f(_: &const [int]) {}
212

3-
fn main() {
13+
pub fn main() {
414
let v = [ 1, 2, 3 ];
515
f(v);
616
}
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
#[deriving(Clone)]
212
enum E {
313
A,
414
B(()),
515
C
616
}
717

8-
fn main() {}
18+
pub fn main() {}
919

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
#[deriving(Clone)]
212
struct S<T> {
313
foo: (),
414
bar: (),
515
baz: T,
616
}
717

8-
fn main() {}
18+
pub fn main() {}
919

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
#[deriving(Clone)]
212
struct S((), ());
313

4-
fn main() {}
14+
pub fn main() {}
515

src/test/run-pass/issue-3556.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn check_strs(actual: &str, expected: &str) -> bool
3030
return true;
3131
}
3232

33-
fn main()
33+
pub fn main()
3434
{
3535
// fail_unless!(check_strs(fmt!("%?", Text(@~"foo")), "Text(@~\"foo\")"));
3636
// fail_unless!(check_strs(fmt!("%?", ETag(@~[~"foo"], @~"bar")), "ETag(@~[ ~\"foo\" ], @~\"bar\")"));

src/test/run-pass/issue-4120.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// option. This file may not be copied, modified, or distributed
1313
// except according to those terms.
1414

15-
fn main()
15+
pub fn main()
1616
{
1717
unsafe {
1818
libc::exit(0);

src/test/run-pass/issue-4387.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
fn main() {
11+
pub fn main() {
1212
let foo = [0, ..2*4];
1313
}

src/test/run-pass/issue-4448.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
fn main() {
11+
pub fn main() {
1212
let (port, chan) = comm::stream::<&'static str>();
1313

1414
do task::spawn {

src/test/run-pass/issue-5243.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ struct S<'self> {
1818

1919
fn f<'lt>(_s: &'lt S<'lt>) {}
2020

21-
fn main() {
21+
pub fn main() {
2222
f(& S { v: &42 });
2323
}

src/test/run-pass/log-poly.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
enum Numbers {
212
Three
313
}
414

5-
fn main() {
15+
pub fn main() {
616
debug!(1);
717
info!(2.0);
818
warn!(Three);
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
use core::io::println;
212

313
static FOO: int = 3;
414

5-
fn main() {
15+
pub fn main() {
616
println(fmt!("%d", FOO));
717
}
818

src/test/run-pass/new-style-fixed-length-vec.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
use core::io::println;
212

313
static FOO: [int, ..3] = [1, 2, 3];
414

5-
fn main() {
15+
pub fn main() {
616
println(fmt!("%d %d %d", FOO[0], FOO[1], FOO[2]));
717
}
818

src/test/run-pass/one-tuple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// Why one-tuples? Because macros.
1212

13-
fn main() {
13+
pub fn main() {
1414
match ('c',) {
1515
(x,) => {
1616
fail_unless!(x == 'c');

src/test/run-pass/option_addition.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
fn main() {
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub fn main() {
212
let foo = 1;
313
let bar = 2;
414
let foobar = foo + bar;

src/test/run-pass/regions-expl-self.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -18,4 +18,4 @@ pub impl Foo {
1818
fn foo(&'a self) {}
1919
}
2020

21-
fn main() {}
21+
pub fn main() {}

src/test/run-pass/regions-parameterization-self-types-issue-5224.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
111
// Test how region-parameterization inference
212
// interacts with explicit self types.
313
//
@@ -22,7 +32,7 @@ fn get_int<G: Getter>(g: &G) -> int {
2232
*g.get()
2333
}
2434

25-
fn main() {
35+
pub fn main() {
2636
let foo = Foo { field: 22 };
2737
fail_unless!(get_int(&foo) == 22);
2838
}

0 commit comments

Comments
 (0)