Kaydet (Commit) 58f0a20b authored tarafından SiegeLord's avatar SiegeLord

Rust: Update test sources to be valid Rust code.

üst d9e56939
#! fn ignored_in_comment() {}
#[feature(globs)];
#[feature(macro_rules)];
#![feature(globs)]
#![feature(macro_rules)]
use std::*;
use std::io::stdio::println;
use test_input2::*;
......@@ -55,18 +55,18 @@ macro_rules! test_macro
macro_rules! ignore (($($x:tt)*) => (()))
fn yada(a:int,c:Foo,b:test_input2::fruit::SomeStruct) -> ~str {
a.to_str()
fn yada(a:int,c:Foo,b:test_input2::fruit::SomeStruct) -> String {
a.to_string()
}
fn main() {
use test_input2::fruit::*;
io::println(foo_bar_test_func(SomeStruct{red_value:1,green_value:2,blue_value:3},(4,5)).to_str());
io::println(foo_bar_test_func(SomeStruct{red_value:1,green_value:2,blue_value:3},(4,5)).to_string().as_slice());
let a=Foo{foo_field_1:2};
a.my_method(1);
let c=a_cat(3);
let d=Foo{foo_field_1:a.foo_field_1+2}; a.test();
println(a.foo_field_1.to_str());
println(a.foo_field_1.to_string().as_slice());
ignore!
(
fn ignored_inside_macro() {}
......@@ -122,21 +122,21 @@ trait DoZ {
impl Testable for Foo {
fn test(&self) {
println(self.foo_field_1.to_str());
println(self.foo_field_1.to_string().as_slice());
}
fn test1(&self) {
println(self.foo_field_1.to_str());
println(self.foo_field_1.to_string().as_slice());
}
fn test2(&self) {
println(self.foo_field_1.to_str());
println(self.foo_field_1.to_string().as_slice());
}
}
impl DoZ for Foo {
fn do_z(&self) {
println(self.foo_field_1.to_str());
println(self.foo_field_1.to_string().as_slice());
}
}
......
......@@ -49,4 +49,4 @@ test_macro
x8Foo20
x8TraitedStructTest0
y8Foo20
yada16(a:int,c:Foo,b:test_input2::fruit::SomeStruct) -> ~str0
yada16(a:int,c:Foo,b:test_input2::fruit::SomeStruct) -> String0
#![cfg(not(test))] fn not_hashbang() {}
use std::io::stdio::println;
pub fn foo_bar_test_func(apples:fruit::SomeStruct,(oranges,lemon):(int,int))->int{
use std::io::stdio::println;
let some_var_name=2*oranges;
let a=SomeLongStructName{v:0};
println("a");println("b"); println("c");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment