-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add missing tests for all assertions
- Loading branch information
1 parent
63532f0
commit c1ff406
Showing
9 changed files
with
123 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use smoothy::assert_that; | ||
|
||
mod succeeds { | ||
use super::*; | ||
|
||
#[test] | ||
fn with_numbers() { | ||
assert_that(12).not_equals(21); | ||
} | ||
|
||
#[test] | ||
fn with_strings() { | ||
assert_that(String::from("Yo")).not_equals("Hello There!"); | ||
} | ||
} | ||
|
||
mod fails { | ||
use super::*; | ||
|
||
#[test] | ||
#[should_panic = "assertion failed: `(left != right)`"] | ||
fn with_matching_values() { | ||
assert_that(12).not_equals(12); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use smoothy::assert_that; | ||
|
||
mod succeeds { | ||
use super::*; | ||
|
||
#[test] | ||
fn with_numbers() { | ||
assert_that(42u8).try_into_equals(42i8); | ||
} | ||
} | ||
|
||
mod fails { | ||
use super::*; | ||
|
||
#[test] | ||
#[should_panic = "assertion failed:"] | ||
fn with_conversion_error() { | ||
assert_that(42u8).try_into_equals(-42i8); | ||
} | ||
|
||
#[test] | ||
#[should_panic = "assertion failed: `(left == right)`"] | ||
fn with_numbers() { | ||
assert_that(42u8).try_into_equals(100i8); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use smoothy::assert_that; | ||
|
||
mod succeeds { | ||
use super::*; | ||
|
||
#[test] | ||
fn with_numbers() { | ||
assert_that(42u8).try_into_not_equals(100i8); | ||
} | ||
} | ||
|
||
mod fails { | ||
use super::*; | ||
|
||
#[test] | ||
#[should_panic = "assertion failed:"] | ||
fn with_conversion_error() { | ||
assert_that(42u8).try_into_not_equals(-100i8); | ||
} | ||
|
||
#[test] | ||
#[should_panic = "assertion failed: `(left != right)`"] | ||
fn with_numbers() { | ||
assert_that(42u8).try_into_not_equals(42i8); | ||
} | ||
} |