Skip to content

Commit

Permalink
Rust: Update ctags tests.
Browse files Browse the repository at this point in the history
Also, make them compile again with the Rust compiler.
  • Loading branch information
SiegeLord committed Apr 2, 2014
1 parent 478534e commit 2a80759
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
24 changes: 23 additions & 1 deletion tests/ctags/test_input.rs
Expand Up @@ -2,9 +2,25 @@
#[feature(globs)];
#[feature(macro_rules)];
use std::*;
use std::io::stdio::println;
use test_input2::*;
mod test_input2;

pub struct A
{
foo: fn() -> int,
bar: int
}

pub struct B
{
#![cfg(test)]
#[cfg(test)]
foo: int,
#![cfg(test)]
bar: int
}

/*
* fn ignored_in_comment() {}
*/
Expand All @@ -27,6 +43,8 @@ macro_rules! test_macro
() => {1}
}

macro_rules! ignore (($($x:tt)*) => (()))

fn yada(a:int,c:Foo,b:test_input2::fruit::SomeStruct) -> ~str {
a.to_str()
}
Expand All @@ -43,6 +61,10 @@ fn main() {
(
fn ignored_inside_macro() {}
)
ignore!
[
fn ignored_inside_macro() {}
]

let _ = "fn ignored_in_string() {}
";
Expand All @@ -64,7 +86,7 @@ struct Foo2 {
}

impl Foo {
fn my_method(&self,_:int){ print("my_method of foo");}
fn my_method(&self,_:int){ println("my_method of foo");}
}

enum Animal {
Expand Down
7 changes: 7 additions & 0 deletions tests/ctags/test_input.rs.tags
@@ -1,5 +1,7 @@
# format=tagmanager
A�2048�0
Animal�2�0
B�2048�0
Bar�2048�0
Baz�2048�0
DoZ�32�0
Expand All @@ -16,10 +18,15 @@ a_anteater
a_bear�4�Animal�0
a_cat�4�Animal�0
a_dog�4�Animal�0
bar�8�A�0
bar�8�B�0
do_z�128�(&self)�DoZ�0
do_z�128�(&self)�Foo�0
foo�8�A�0
foo�8�B�0
foo_field_1�8�Foo�0
gfunc�16�<X:Testable+DoZ>(x:&X)�0
ignore�65536�0
main�16�()�0
my_method�128�(&self,_:int)�Foo�0
nested�16�()�main�0
Expand Down
2 changes: 2 additions & 0 deletions tests/ctags/test_input2.rs
@@ -1,3 +1,5 @@
use std::io::stdio::println;

pub fn foo_bar_test_func(apples:fruit::SomeStruct,(oranges,lemon):(int,int))->int{
let some_var_name=2*oranges;
let a=SomeLongStructName{v:0};
Expand Down

0 comments on commit 2a80759

Please sign in to comment.