1
Fork 0

tests: Move run-pass tests without naming conflicts to ui

This commit is contained in:
Vadim Petrochenkov 2019-07-27 01:33:01 +03:00
parent ca9faa52f5
commit 9be35f82c1
3226 changed files with 64 additions and 196 deletions

View file

@ -1,32 +0,0 @@
// run-pass
#![allow(non_camel_case_types)]
// Tests for if as expressions returning nominal types
#[derive(Copy, Clone)]
struct I { i: isize }
fn test_rec() {
let rs = if true { I {i: 100} } else { I {i: 101} };
assert_eq!(rs.i, 100);
}
#[derive(Copy, Clone, Debug)]
enum mood { happy, sad, }
impl PartialEq for mood {
fn eq(&self, other: &mood) -> bool {
((*self) as usize) == ((*other) as usize)
}
fn ne(&self, other: &mood) -> bool { !(*self).eq(other) }
}
fn test_tag() {
let rs = if true { mood::happy } else { mood::sad };
assert_eq!(rs, mood::happy);
}
pub fn main() { test_rec(); test_tag(); }