Skip to content

Commit

Permalink
Add test of negative literal
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Feb 19, 2022
1 parent 91b027e commit c36c0fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_ensure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,14 @@ fn test_path() {
fn f<const I: isize>() {}
let test = || Ok(ensure!(f::<1>() != ()));
assert_err(test, "Condition failed: `f::<1>() != ()` (() vs ())");
let test = || Ok(ensure!(f::<-1>() != ()));
assert_err(test, "Condition failed: `f::<-1>() != ()`"); // FIXME

fn g<T, const I: isize>() {}
let test = || Ok(ensure!(g::<u8, 1>() != ()));
assert_err(test, "Condition failed: `g::<u8, 1>() != ()` (() vs ())");
let test = || Ok(ensure!(g::<u8, -1>() != ()));
assert_err(test, "Condition failed: `g::<u8, -1>() != ()` (() vs ())");

#[derive(PartialOrd, PartialEq, Debug)]
enum E<'a, T> {
Expand Down

0 comments on commit c36c0fd

Please sign in to comment.