renamed few tests
This commit is contained in:
parent
ddd8f92c8d
commit
158410457f
8 changed files with 103 additions and 65 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Regression test for https://github.com/rust-lang/rust/issues/3026
|
||||||
|
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,34 @@
|
||||||
|
//! Regression test for https://github.com/rust-lang/rust/issues/3121
|
||||||
|
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
enum side { mayo, catsup, vinegar }
|
enum side {
|
||||||
|
mayo,
|
||||||
|
catsup,
|
||||||
|
vinegar,
|
||||||
|
}
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
enum order { hamburger, fries(side), shake }
|
enum order {
|
||||||
|
hamburger,
|
||||||
|
fries(side),
|
||||||
|
shake,
|
||||||
|
}
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
enum meal { to_go(order), for_here(order) }
|
enum meal {
|
||||||
|
to_go(order),
|
||||||
|
for_here(order),
|
||||||
|
}
|
||||||
|
|
||||||
fn foo(m: Box<meal>, cond: bool) {
|
fn foo(m: Box<meal>, cond: bool) {
|
||||||
match *m {
|
match *m {
|
||||||
meal::to_go(_) => { }
|
meal::to_go(_) => {}
|
||||||
meal::for_here(_) if cond => {}
|
meal::for_here(_) if cond => {}
|
||||||
meal::for_here(order::hamburger) => {}
|
meal::for_here(order::hamburger) => {}
|
||||||
meal::for_here(order::fries(_s)) => {}
|
meal::for_here(order::fries(_s)) => {}
|
||||||
meal::for_here(order::shake) => {}
|
meal::for_here(order::shake) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Regression test for https://github.com/rust-lang/rust/issues/3029
|
||||||
|
|
||||||
//@ run-fail
|
//@ run-fail
|
||||||
//@ error-pattern:so long
|
//@ error-pattern:so long
|
||||||
//@ needs-subprocess
|
//@ needs-subprocess
|
||||||
|
|
|
||||||
|
|
@ -1,60 +1,80 @@
|
||||||
|
//! Regression test for https://github.com/rust-lang/rust/issues/2904
|
||||||
|
|
||||||
//@ build-pass
|
//@ build-pass
|
||||||
#![allow(unused_must_use)]
|
#![allow(unused_must_use)]
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![allow(unused_mut)]
|
#![allow(unused_mut)]
|
||||||
#![allow(non_camel_case_types)]
|
|
||||||
|
|
||||||
// Map representation
|
// Map representation
|
||||||
|
|
||||||
|
use Square::{Bot, ClosedLift, Earth, Empty, Lambda, OpenLift, Rock, Wall};
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use square::{bot, wall, rock, lambda, closed_lift, open_lift, earth, empty};
|
|
||||||
|
|
||||||
enum square {
|
enum Square {
|
||||||
bot,
|
Bot,
|
||||||
wall,
|
Wall,
|
||||||
rock,
|
Rock,
|
||||||
lambda,
|
Lambda,
|
||||||
closed_lift,
|
ClosedLift,
|
||||||
open_lift,
|
OpenLift,
|
||||||
earth,
|
Earth,
|
||||||
empty
|
Empty,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for square {
|
impl fmt::Debug for Square {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "{}", match *self {
|
write!(
|
||||||
bot => { "R".to_string() }
|
f,
|
||||||
wall => { "#".to_string() }
|
"{}",
|
||||||
rock => { "*".to_string() }
|
match *self {
|
||||||
lambda => { "\\".to_string() }
|
Bot => {
|
||||||
closed_lift => { "L".to_string() }
|
"R".to_string()
|
||||||
open_lift => { "O".to_string() }
|
}
|
||||||
earth => { ".".to_string() }
|
Wall => {
|
||||||
empty => { " ".to_string() }
|
"#".to_string()
|
||||||
})
|
}
|
||||||
|
Rock => {
|
||||||
|
"*".to_string()
|
||||||
|
}
|
||||||
|
Lambda => {
|
||||||
|
"\\".to_string()
|
||||||
|
}
|
||||||
|
ClosedLift => {
|
||||||
|
"L".to_string()
|
||||||
|
}
|
||||||
|
OpenLift => {
|
||||||
|
"O".to_string()
|
||||||
|
}
|
||||||
|
Earth => {
|
||||||
|
".".to_string()
|
||||||
|
}
|
||||||
|
Empty => {
|
||||||
|
" ".to_string()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn square_from_char(c: char) -> square {
|
fn square_from_char(c: char) -> Square {
|
||||||
match c {
|
match c {
|
||||||
'R' => { bot }
|
'R' => Bot,
|
||||||
'#' => { wall }
|
'#' => Wall,
|
||||||
'*' => { rock }
|
'*' => Rock,
|
||||||
'\\' => { lambda }
|
'\\' => Lambda,
|
||||||
'L' => { closed_lift }
|
'L' => ClosedLift,
|
||||||
'O' => { open_lift }
|
'O' => OpenLift,
|
||||||
'.' => { earth }
|
'.' => Earth,
|
||||||
' ' => { empty }
|
' ' => Empty,
|
||||||
_ => {
|
_ => {
|
||||||
println!("invalid square: {}", c);
|
println!("invalid Square: {}", c);
|
||||||
panic!()
|
panic!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_board_grid<rdr:'static + Read>(mut input: rdr)
|
fn read_board_grid<Rdr: 'static + Read>(mut input: Rdr) -> Vec<Vec<Square>> {
|
||||||
-> Vec<Vec<square>> {
|
|
||||||
let mut input: &mut dyn Read = &mut input;
|
let mut input: &mut dyn Read = &mut input;
|
||||||
let mut grid = Vec::new();
|
let mut grid = Vec::new();
|
||||||
let mut line = [0; 10];
|
let mut line = [0; 10];
|
||||||
|
|
@ -65,14 +85,16 @@ fn read_board_grid<rdr:'static + Read>(mut input: rdr)
|
||||||
}
|
}
|
||||||
grid.push(row);
|
grid.push(row);
|
||||||
let width = grid[0].len();
|
let width = grid[0].len();
|
||||||
for row in &grid { assert_eq!(row.len(), width) }
|
for row in &grid {
|
||||||
|
assert_eq!(row.len(), width)
|
||||||
|
}
|
||||||
grid
|
grid
|
||||||
}
|
}
|
||||||
|
|
||||||
mod test {
|
mod test {
|
||||||
#[test]
|
#[test]
|
||||||
pub fn trivial_to_string() {
|
pub fn trivial_to_string() {
|
||||||
assert_eq!(lambda.to_string(), "\\")
|
assert_eq!(Lambda.to_string(), "\\")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,13 @@
|
||||||
|
//! Regression test for https://github.com/rust-lang/rust/issues/2708
|
||||||
|
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
struct Font {
|
struct Font {
|
||||||
fontbuf: usize,
|
fontbuf: usize,
|
||||||
cairo_font: usize,
|
cairo_font: usize,
|
||||||
font_dtor: usize,
|
font_dtor: usize,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for Font {
|
impl Drop for Font {
|
||||||
|
|
@ -17,11 +15,7 @@ impl Drop for Font {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn Font() -> Font {
|
fn Font() -> Font {
|
||||||
Font {
|
Font { fontbuf: 0, cairo_font: 0, font_dtor: 0 }
|
||||||
fontbuf: 0,
|
|
||||||
cairo_font: 0,
|
|
||||||
font_dtor: 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
|
//! Regression test for https://github.com/rust-lang/rust/issues/2895
|
||||||
|
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
||||||
struct Cat {
|
struct Cat {
|
||||||
x: isize
|
x: isize,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Kitty {
|
struct Kitty {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Regression test for https://github.com/rust-lang/rust/issues/2935
|
||||||
|
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![allow(non_camel_case_types)]
|
#![allow(non_camel_case_types)]
|
||||||
|
|
@ -11,14 +13,14 @@ trait it {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl it for t {
|
impl it for t {
|
||||||
fn f(&self) { }
|
fn f(&self) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
// let x = ({a: 4} as it);
|
// let x = ({a: 4} as it);
|
||||||
// let y = box ({a: 4});
|
// let y = box ({a: 4});
|
||||||
// let z = box ({a: 4} as it);
|
// let z = box ({a: 4} as it);
|
||||||
// let z = box ({a: true} as it);
|
// let z = box ({a: true} as it);
|
||||||
let z: Box<_> = Box::new(Box::new(true) as Box<dyn it>);
|
let z: Box<_> = Box::new(Box::new(true) as Box<dyn it>);
|
||||||
// x.f();
|
// x.f();
|
||||||
// y.f();
|
// y.f();
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
//! Regression test for https://github.com/rust-lang/rust/issues/3052
|
||||||
|
|
||||||
//@ run-pass
|
//@ run-pass
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
|
|
@ -8,5 +10,4 @@ fn f() -> Option<Connection> {
|
||||||
Some(mock_connection)
|
Some(mock_connection)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {}
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue