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
}

0 commit comments

Comments
 (0)