Skip to content

Add a terrible, but useful, test which I used locally #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/source/doc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

// sadfsdfa
//sdffsdfasdf
127 changes: 127 additions & 0 deletions tests/source/multiple.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// Test of lots of random stuff.
// FIXME split this into multiple, self-contained tests.


#[attr1] extern crate foo;
#[attr2] #[attr3] extern crate foo;
#[attr1]extern crate foo;
#[attr2]#[attr3]extern crate foo;

use std::cell::*;
use std::{any, ascii, self, borrow, boxed, char, borrow, boxed, char, borrow, borrow, boxed, char, borrow, boxed, char, borrow, boxed, char, borrow, boxed, char, borrow, boxed, char, borrow, boxed, char, borrow, boxed, char, borrow, boxed, char};

mod doc;
mod other;


// sfdgfffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffff

fn foo(a: isize,
b: u32, /* blah blah */
c: f64) {

}

fn foo() where 'a: 'b, for<'a> D<'b>: 'a {
hello!()
}

fn baz<'a: 'b /* comment on 'a */, T: SomsssssssssssssssssssssssssssssssssssssssssssssssssssssseType /* comment on T */>(a: A, b: B /* comment on b */, c: C) -> Bob {
#[attr1] extern crate foo;
#[attr2] #[attr3] extern crate foo;
#[attr1]extern crate foo;
#[attr2]#[attr3]extern crate foo;
}

#[rustfmt_skip]
fn qux(a: dadsfa, // Comment 1
b: sdfasdfa, // Comment 2
c: dsfdsafa) // Comment 3
{

}

/// Blah blah blah.
impl Bar {
fn foo(&mut self, a: sdfsdfcccccccccccccccccccccccccccccccccccccccccccccccccccccccc, // comment on a
b: sdfasdfsdfasfs /*closing comment*/ ) -> isize {}

/// Blah blah blah.
pub fn f2(self) {
(foo, bar)
}

#[an_attribute]
fn f3(self) -> Dog {
}
}

/// The `nodes` and `edges` method each return instantiations of
/// `Cow<[T]>` to leave implementers the freedom to create

/// entirely new vectors or to pass back slices into internally owned
/// vectors.
pub trait GraphWalk<'a, N, E> {
/// Returns all the nodes in this graph.
fn nodes(&'a self) -> Nodes<'a, N>;
/// Returns all of the edges in this graph.
fn edges(&'a self) -> Edges<'a, E>;
/// The source node for `edge`.
fn source(&'a self, edge: &E) -> N;
/// The target node for `edge`.
fn target(&'a self, edge: &E) -> N;
}

/// A Doc comment
#[AnAttribute]
pub struct Foo {
#[rustfmt_skip]
f : SomeType, // Comment beside a field
f : SomeType, // Comment beside a field
// Comment on a field
g: SomeOtherType,
/// A doc comment on a field
h: AThirdType,}

struct Bar;

// With a where clause and generics.
pub struct Foo<'a, Y: Baz>
where X: Whatever
{
f: SomeType, // Comment beside a field
}

fn main() {
for i in 0i32..4 {
println!("{}", i);
}


while true {
hello();
}

let rc = Cell::new(42usize,42usize, Cell::new(42usize, remaining_widthremaining_widthremaining_widthremaining_width), 42usize);
let rc = RefCell::new(42usize,remaining_width, remaining_width); // a comment
let x = "Hello!!!!!!!!! abcd abcd abcd abcd abcd abcd\n abcd abcd abcd abcd abcd abcd abcd abcd abcd \
abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd \
abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd"; }


fn struct_lits() {
let x = Bar;
// Comment
let y = Foo { a: x };
Foo { a: foo() /* comment*/, /* comment*/ b: bar(), ..something };
Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: foo(), b: bar(), };
Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo {
// Comment
a: foo(), // Comment
// Comment
b: bar(), // Comment
};

Foo { a: Bar,
b: foo() };
}
5 changes: 5 additions & 0 deletions tests/source/other.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Part of multiple.rs

fn bob() {
println!("hello other!");
}
3 changes: 3 additions & 0 deletions tests/target/doc.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

// sadfsdfa
//sdffsdfasdf
154 changes: 154 additions & 0 deletions tests/target/multiple.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
// Test of lots of random stuff.
// FIXME split this into multiple, self-contained tests.


#[attr1]
extern crate foo;
#[attr2]
#[attr3]
extern crate foo;
#[attr1]
extern crate foo;
#[attr2]
#[attr3]
extern crate foo;

use std::cell::*;
use std::{self, any, ascii, borrow, boxed, char, borrow, boxed, char, borrow,
borrow, boxed, char, borrow, boxed, char, borrow, boxed, char,
borrow, boxed, char, borrow, boxed, char, borrow, boxed, char,
borrow, boxed, char, borrow, boxed, char};

mod doc;
mod other;


// sfdgfffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffff

fn foo(a: isize, b: u32 /* blah blah */, c: f64) {

}

fn foo()
where 'a: 'b,
for<'a> D<'b>: 'a
{
hello!()
}

fn baz<'a: 'b, /* comment on 'a */
T: SomsssssssssssssssssssssssssssssssssssssssssssssssssssssseType /* comment on T */>
(a: A,
b: B, /* comment on b */
c: C)
-> Bob {
#[attr1]
extern crate foo;
#[attr2]
#[attr3]
extern crate foo;
#[attr1]
extern crate foo;
#[attr2]
#[attr3]
extern crate foo;
}

#[rustfmt_skip]
fn qux(a: dadsfa, // Comment 1
b: sdfasdfa, // Comment 2
c: dsfdsafa) // Comment 3
{

}

/// Blah blah blah.
impl Bar {
fn foo(&mut self,
a: sdfsdfcccccccccccccccccccccccccccccccccccccccccccccccccccccccc, // comment on a
b: sdfasdfsdfasfs /*closing comment*/)
-> isize {
}

/// Blah blah blah.
pub fn f2(self) {
(foo, bar)
}

#[an_attribute]
fn f3(self) -> Dog {
}
}

/// The `nodes` and `edges` method each return instantiations of
/// `Cow<[T]>` to leave implementers the freedom to create

/// entirely new vectors or to pass back slices into internally owned
/// vectors.
pub trait GraphWalk<'a, N, E> {
/// Returns all the nodes in this graph.
fn nodes(&'a self) -> Nodes<'a, N>;
/// Returns all of the edges in this graph.
fn edges(&'a self) -> Edges<'a, E>;
/// The source node for `edge`.
fn source(&'a self, edge: &E) -> N;
/// The target node for `edge`.
fn target(&'a self, edge: &E) -> N;
}

/// A Doc comment
#[AnAttribute]
pub struct Foo {
#[rustfmt_skip]
f : SomeType, // Comment beside a field
f: SomeType, // Comment beside a field
// Comment on a field
g: SomeOtherType,
/// A doc comment on a field
h: AThirdType,
}

struct Bar;

// With a where clause and generics.
pub struct Foo<'a, Y: Baz>
where X: Whatever
{
f: SomeType, // Comment beside a field
}

fn main() {
for i in 0i32..4 {
println!("{}", i);
}


while true {
hello();
}

let rc = Cell::new(42usize,
42usize,
Cell::new(42usize,
remaining_widthremaining_widthremaining_widthremaining_width),
42usize);
let rc = RefCell::new(42usize, remaining_width, remaining_width); // a comment
let x = "Hello!!!!!!!!! abcd abcd abcd abcd abcd abcd\n abcd abcd abcd abcd abcd abcd abcd \
abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd \
abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd abcd \
abcd";
}


fn struct_lits() {
let x = Bar;
// Comment
let y = Foo { a: x };
Foo { a: foo(), b: bar(), ..something };
Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: foo(),
b: bar(), };
Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: foo(),
b: bar(), };

Foo { a: Bar, b: foo() };
}
5 changes: 5 additions & 0 deletions tests/target/other.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Part of multiple.rs

fn bob() {
println!("hello other!");
}