File tree Expand file tree Collapse file tree
fortifier-macros/src/validate Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ use fortifier::Validate;
44use regex:: Regex ;
55
66static COUNTRY_CODE_REGEX : LazyLock < Regex > =
7- LazyLock :: new ( || Regex :: new ( r"[A-Z]{2}" ) . expect ( "Regex should be valid. " ) ) ;
7+ LazyLock :: new ( || Regex :: new ( r"[A-Z]{2}" ) . expect ( "valid regex " ) ) ;
88
99#[ derive( Validate ) ]
1010pub struct CreateUser {
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ mod tests {
106106 use super :: should_validate_type;
107107
108108 fn validate ( tokens : TokenStream ) -> bool {
109- should_validate_type ( & syn:: parse2 ( tokens) . expect ( "Type should be valid. " ) )
109+ should_validate_type ( & syn:: parse2 ( tokens) . expect ( "valid type " ) )
110110 }
111111
112112 #[ test]
Original file line number Diff line number Diff line change @@ -150,8 +150,7 @@ mod tests {
150150
151151 use super :: { RegexError , ValidateRegex } ;
152152
153- static REGEX : LazyLock < Regex > =
154- LazyLock :: new ( || Regex :: new ( r"[0-9]{4}" ) . expect ( "Regex should be valid." ) ) ;
153+ static REGEX : LazyLock < Regex > = LazyLock :: new ( || Regex :: new ( r"[0-9]{4}" ) . expect ( "valid regex" ) ) ;
155154
156155 #[ test]
157156 fn ok ( ) {
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ mod tests {
250250 ) ;
251251 assert_eq ! (
252252 Url :: parse( "http://localhost" )
253- . expect( "URL should be valid. " )
253+ . expect( "valid URL " )
254254 . validate_url( ) ,
255255 Ok ( ( ) )
256256 ) ;
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ fn serialize() {
8282 let ( deserialized, serialized) = setup ( ) ;
8383
8484 assert_eq ! (
85- serde_json:: to_value( & deserialized) . expect( "Value should be serializable. " ) ,
85+ serde_json:: to_value( & deserialized) . expect( "serializable value " ) ,
8686 serialized
8787 ) ;
8888}
@@ -93,7 +93,7 @@ fn deserialize() {
9393
9494 assert_eq ! (
9595 serde_json:: from_value:: <ValidationErrors <TestError >>( serialized)
96- . expect( "Value should be deserializable. " ) ,
96+ . expect( "deserializable value " ) ,
9797 deserialized,
9898 ) ;
9999}
You can’t perform that action at this time.
0 commit comments