Permalink
Browse files

Clean up Rust ctag tests and make them more comprehensive

  • Loading branch information...
SiegeLord committed Oct 18, 2013
1 parent 3706668 commit 416c3daecc649b63c96503f5c43de37b19220b11
Showing with 71 additions and 17 deletions.
  1. +60 −12 tests/ctags/test_input.rs
  2. +10 −1 tests/ctags/test_input.rs.tags
  3. +1 −4 tests/ctags/test_input2.rs
View
@@ -1,9 +1,36 @@
+#! fn ignored_in_comment() {}
#[feature(globs)];
+#[feature(macro_rules)];
use std::*;
use test_input2::*;
mod test_input2;
-fn yada(a:int,c:Foo,b:test_input2::fruit::SomeStruct)->~str { a.to_str() }
+/*
+ * fn ignored_in_comment() {}
+ */
+
+// fn ignored_in_comment() {}
+
+/* /*
+ * */
+ fn ignored_in_nested_comment() {}
+ */
+
+static size: uint = 1;
+
+struct S1 {
+ only_field: [int, ..size]
+}
+
+macro_rules! test_macro
+{
+ () => {1}
+}
+
+fn yada(a:int,c:Foo,b:test_input2::fruit::SomeStruct) -> ~str {
+ a.to_str()
+}
+
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());
@@ -12,11 +39,25 @@ fn main() {
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());
+ ignore!
+ (
+ fn ignored_inside_macro() {}
+ )
+
+ let _ = "fn ignored_in_string() {}
+ ";
+
+ let _ = r##"fn ignored_in_raw_string() {}""##;
+
+ fn nested() {}
}
+
struct Bar(int);
+
struct Baz(int);
struct Foo{foo_field_1:int}
+
struct Foo2 {
x:int,
y:int
@@ -38,6 +79,7 @@ trait Testable
fn test1(&self);
fn test2(&self);
}
+
trait DoZ {
fn do_z(&self);
}
@@ -46,15 +88,16 @@ impl Testable for Foo {
fn test(&self) {
println(self.foo_field_1.to_str());
}
- fn test1(&self)
- {
- println(self.foo_field_1.to_str());
- } fn test2(&self)
- {
+
+ fn test1(&self) {
println(self.foo_field_1.to_str());
}
+ fn test2(&self) {
+ println(self.foo_field_1.to_str());
+ }
}
+
impl DoZ for Foo {
fn do_z(&self) {
println(self.foo_field_1.to_str());
@@ -72,19 +115,24 @@ fn gfunc<X:Testable+DoZ>(x:&X) {
x.test();
x.do_z();
}
+
struct TraitedStructTest<X> {
x:X
}
+
+trait ParametrizedTrait<T> {
+ fn test(&self);
+}
+
+impl<T: Clone> ParametrizedTrait<T> for TraitedStructTest<T> {
+ fn test(&self) {
+ }
+}
+
fn some2(a:Animal) {
match a {
a_cat(x)=> println("cat"),
_ => println("not a cat")
}
}
-
-
-
-
-
-
@@ -6,8 +6,11 @@ DoZ
Foo�1�0
Foo�2048�0
Foo2�2048�0
+ParametrizedTrait�32�0
+S1�2048�0
SuperTraitTest�32�0
Testable�32�0
+TraitedStructTest�1�0
TraitedStructTest�2048�0
a_anteater�4�Animal�0
a_bear�4�Animal�0
@@ -19,15 +22,21 @@ foo_field_1
gfunc�16�<X:Testable+DoZ>(x:&X)�0
main�16�()�0
my_method�128�(&self,_:int)�Foo�0
+nested�16�()�main�0
+only_field�8�S1�0
+size�16384�0
some2�16�(a:Animal)�0
test�128�(&self)�Foo�0
+test�128�(&self)�ParametrizedTrait�0
test�128�(&self)�Testable�0
+test�128�(&self)�TraitedStructTest�0
test1�128�(&self)�Foo�0
test1�128�(&self)�Testable�0
test2�128�(&self)�Foo�0
test2�128�(&self)�Testable�0
test_input2�256�0
+test_macro�65536�0
x�8�Foo2�0
x�8�TraitedStructTest�0
y�8�Foo2�0
-yada�16�(a:int,c:Foo,b:test_input2::fruit::SomeStruct)->~str�0
+yada�16�(a:int,c:Foo,b:test_input2::fruit::SomeStruct) -> ~str�0
@@ -6,12 +6,12 @@ pub fn foo_bar_test_func(apples:fruit::SomeStruct,(oranges,lemon):(int,int))->in
some_var_name-apples.red_value+lemon+a.v
}
-
pub mod fruit {
pub struct SomeStruct{
red_value:int,green_value:int,blue_value:int
}
}
+
fn free_func() {
}
@@ -22,7 +22,6 @@ impl SomeLongStructName {
}
}
-
pub struct SomeLongStructName {v:int}
mod veg{
@@ -31,8 +30,6 @@ mod veg{
}
}
-
-
mod mineral {
fn granite() {
}

0 comments on commit 416c3da

Please sign in to comment.