Skip to content

Commit

Permalink
Move opaque type tests into separate module
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwhit committed May 20, 2020
1 parent 24163d9 commit 97a84ca
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 46 deletions.
46 changes: 0 additions & 46 deletions tests/test/existential_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,6 @@
use super::*;

#[test]
fn opaque_bounds() {
test! {
program {
struct Ty { }

trait Clone { }
opaque type T: Clone = Ty;
}

goal {
T: Clone
} yields {
"Unique; substitution []"
}
}
}

#[test]
fn opaque_reveal() {
test! {
program {
struct Ty { }
trait Trait { }
impl Trait for Ty { }

trait Clone { }
opaque type T: Clone = Ty;
}

goal {
if (Reveal) {
T: Trait
}
} yields {
"Unique; substitution []"
}

goal {
T: Trait
} yields {
"No possible solution"
}
}
}

#[test]
fn dyn_Clone_is_Clone() {
test! {
Expand Down
1 change: 1 addition & 0 deletions tests/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ mod impls;
mod misc;
mod negation;
mod object_safe;
mod opaque_types;
mod projection;
mod refs;
mod scalars;
Expand Down
47 changes: 47 additions & 0 deletions tests/test/opaque_types.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
use super::*;

#[test]
fn opaque_bounds() {
test! {
program {
struct Ty { }

trait Clone { }
opaque type T: Clone = Ty;
}

goal {
T: Clone
} yields {
"Unique; substitution []"
}
}
}

#[test]
fn opaque_reveal() {
test! {
program {
struct Ty { }
trait Trait { }
impl Trait for Ty { }

trait Clone { }
opaque type T: Clone = Ty;
}

goal {
if (Reveal) {
T: Trait
}
} yields {
"Unique; substitution []"
}

goal {
T: Trait
} yields {
"No possible solution"
}
}
}

0 comments on commit 97a84ca

Please sign in to comment.