Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified examples/colored_diffs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 6 additions & 8 deletions src/bigdecimal/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn verify_bigdecimal_is_equal_to_other_fails() {
assert_eq!(
failures,
&[
r"assertion failed: expected subject to be equal to BigDecimal(sign=Minus, scale=3, digits=[42831])
r"expected subject to be equal to BigDecimal(sign=Minus, scale=3, digits=[42831])
but was: BigDecimal(sign=Plus, scale=3, digits=[42831])
expected: BigDecimal(sign=Minus, scale=3, digits=[42831])
"
Expand Down Expand Up @@ -181,7 +181,7 @@ fn verify_bigdecimalref_is_equal_to_other_fails() {
assert_eq!(
failures,
&[
r"assertion failed: expected subject to be equal to BigDecimalRef { sign: Minus, digits: 42831, scale: 3 }
r"expected subject to be equal to BigDecimalRef { sign: Minus, digits: 42831, scale: 3 }
but was: BigDecimalRef { sign: Plus, digits: 42831, scale: 3 }
expected: BigDecimalRef { sign: Minus, digits: 42831, scale: 3 }
"
Expand Down Expand Up @@ -264,12 +264,10 @@ fn verify_bigdecimal_has_precision_of_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to have a precision of 7
&[r"expected subject to have a precision of 7
but was: 9
expected: 7
"
]
"]
);
}

Expand Down Expand Up @@ -299,7 +297,7 @@ fn verify_bigdecimal_has_scale_of_fails() {

assert_eq!(
failures,
&[r"assertion failed: expected subject to have a scale of 5
&[r"expected subject to have a scale of 5
but was: 2
expected: 5
"]
Expand Down Expand Up @@ -335,7 +333,7 @@ fn verify_bigdecimal_is_integer_fails() {

assert_eq!(
failures,
&[r"assertion failed: expected subject to be an integer value
&[r"expected subject to be an integer value
but was: BigDecimal(sign=Plus, scale=2, digits=[420810])
expected: an integer value
"]
Expand Down
14 changes: 6 additions & 8 deletions src/boolean/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ fn verify_bool_is_not_equal_to_false_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected my_thing to be not equal to false
&[r"expected my_thing to be not equal to false
but was: false
expected: not false
"
]
"]
);
}

Expand All @@ -49,7 +47,7 @@ fn verify_bool_is_true_fails() {
.named("my_thing")
.is_true()
.display_failures(),
&[r"assertion failed: expected my_thing to be true
&[r"expected my_thing to be true
but was: false
expected: true
"]
Expand All @@ -65,7 +63,7 @@ fn verify_bool_is_false_fails() {

assert_eq!(
failures,
&[r"assertion failed: expected my_thing to be false
&[r"expected my_thing to be false
but was: true
expected: false
"]
Expand All @@ -85,7 +83,7 @@ mod colored {

assert_eq!(
failures,
&["assertion failed: expected subject to be true\n \
&["expected subject to be true\n \
but was: \u{1b}[31mfalse\u{1b}[0m\n \
expected: \u{1b}[32mtrue\u{1b}[0m\n\
"]
Expand All @@ -101,7 +99,7 @@ mod colored {

assert_eq!(
failures,
&["assertion failed: expected subject to be false\n \
&["expected subject to be false\n \
but was: \u{1b}[31mtrue\u{1b}[0m\n \
expected: \u{1b}[33mfalse\u{1b}[0m\n\
"]
Expand Down
96 changes: 34 additions & 62 deletions src/char/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn verify_char_is_lowercase_fails() {

assert_eq!(
failures,
&[r"assertion failed: expected subject to be lowercase
&[r"expected subject to be lowercase
but was: M
expected: m
"]
Expand All @@ -30,7 +30,7 @@ fn verify_borrowed_char_is_lowercase_fails() {

assert_eq!(
failures,
&[r"assertion failed: expected subject to be lowercase
&[r"expected subject to be lowercase
but was: M
expected: m
"]
Expand All @@ -48,7 +48,7 @@ fn verify_char_is_uppercase_fails() {

assert_eq!(
failures,
&[r"assertion failed: expected subject to be uppercase
&[r"expected subject to be uppercase
but was: k
expected: K
"]
Expand All @@ -66,7 +66,7 @@ fn verify_borrowed_char_is_uppercase_fails() {

assert_eq!(
failures,
&[r"assertion failed: expected subject to be uppercase
&[r"expected subject to be uppercase
but was: x
expected: X
"]
Expand All @@ -84,12 +84,10 @@ fn verify_char_is_ascii_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be an ASCII character
&[r"expected subject to be an ASCII character
but was: €
expected: an ASCII character
"
]
"]
);
}

Expand All @@ -104,12 +102,10 @@ fn verify_borrowed_char_is_ascii_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be an ASCII character
&[r"expected subject to be an ASCII character
but was: ❤
expected: an ASCII character
"
]
"]
);
}

Expand All @@ -124,12 +120,10 @@ fn verify_char_is_alphabetic_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be an alphabetic character
&[r"expected subject to be an alphabetic character
but was: 1
expected: an alphabetic character
"
]
"]
);
}

Expand All @@ -144,12 +138,10 @@ fn verify_borrowed_char_is_alphabetic_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be an alphabetic character
&[r"expected subject to be an alphabetic character
but was: @
expected: an alphabetic character
"
]
"]
);
}

Expand All @@ -165,12 +157,10 @@ fn verify_char_is_alphanumeric_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be an alphanumeric character
&[r"expected subject to be an alphanumeric character
but was: @
expected: an alphanumeric character
"
]
"]
);
}

Expand All @@ -186,12 +176,10 @@ fn verify_borrowed_char_is_alphanumeric_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be an alphanumeric character
&[r"expected subject to be an alphanumeric character
but was: +
expected: an alphanumeric character
"
]
"]
);
}

Expand All @@ -206,12 +194,10 @@ fn verify_char_is_control_char_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be a control character
&[r"expected subject to be a control character
but was: [
expected: a control character
"
]
"]
);
}

Expand All @@ -226,12 +212,10 @@ fn verify_borrowed_char_is_control_char_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be a control character
&[r"expected subject to be a control character
but was: @
expected: a control character
"
]
"]
);
}

Expand All @@ -246,12 +230,10 @@ fn verify_char_is_digit_in_radix_10_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be a digit in the radix 10
&[r"expected subject to be a digit in the radix 10
but was: A
expected: a digit in the radix 10
"
]
"]
);
}

Expand All @@ -266,12 +248,10 @@ fn verify_borrowed_char_is_digit_in_radix_10_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be a digit in the radix 10
&[r"expected subject to be a digit in the radix 10
but was: F
expected: a digit in the radix 10
"
]
"]
);
}

Expand All @@ -286,12 +266,10 @@ fn verify_char_is_digit_in_radix_16_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be a digit in the radix 16
&[r"expected subject to be a digit in the radix 16
but was: G
expected: a digit in the radix 16
"
]
"]
);
}

Expand All @@ -306,12 +284,10 @@ fn verify_borrowed_char_is_digit_in_radix_16_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be a digit in the radix 16
&[r"expected subject to be a digit in the radix 16
but was: g
expected: a digit in the radix 16
"
]
"]
);
}

Expand All @@ -326,12 +302,10 @@ fn verify_char_is_digit_in_radix_7_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be a digit in the radix 7
&[r"expected subject to be a digit in the radix 7
but was: 7
expected: a digit in the radix 7
"
]
"]
);
}

Expand All @@ -346,12 +320,10 @@ fn verify_borrowed_char_is_digit_in_radix_7_fails() {

assert_eq!(
failures,
&[
r"assertion failed: expected subject to be a digit in the radix 7
&[r"expected subject to be a digit in the radix 7
but was: 9
expected: a digit in the radix 7
"
]
"]
);
}

Expand All @@ -366,7 +338,7 @@ fn verify_char_is_whitespace_fails() {

assert_eq!(
failures,
&[r"assertion failed: expected subject to be whitespace
&[r"expected subject to be whitespace
but was: _
expected: whitespace
"]
Expand All @@ -384,7 +356,7 @@ fn verify_borrowed_char_is_whitespace_fails() {

assert_eq!(
failures,
&[r"assertion failed: expected subject to be whitespace
&[r"expected subject to be whitespace
but was: =
expected: whitespace
"]
Expand Down
2 changes: 1 addition & 1 deletion src/colored/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ mod with_colored_feature {
.display_failures();

assert_eq!(failures, &[
"assertion failed: expected subject to be equal to Some(Foo { lorem: \"Hello World!\", ipsum: 42, dolor: Some(\"hey ho!\") })\n \
"expected subject to be equal to Some(Foo { lorem: \"Hello World!\", ipsum: 42, dolor: Some(\"hey ho!\") })\n \
but was: Some(Foo { lorem: \"\u{1b}[31m¡\u{1b}[0mH\u{1b}[31mo\u{1b}[0ml\u{1b}[31ma,\u{1b}[0m W\u{1b}[31me\u{1b}[0ml\u{1b}[31mt\u{1b}[0m!\", ipsum: 42, dolor: Some(\"hey\") })\n \
expected: Some(Foo { lorem: \"H\u{1b}[32me\u{1b}[0ml\u{1b}[32mlo\u{1b}[0m W\u{1b}[32mor\u{1b}[0ml\u{1b}[32md\u{1b}[0m!\", ipsum: 42, dolor: Some(\"hey\u{1b}[32m ho!\u{1b}[0m\") })\n\
",
Expand Down
Loading
Loading