@@ -264,7 +264,7 @@ fn check_posix_regex_errors(pattern: &str) -> ExprResult<()> {
264264 ( true , true , false ) => Ok ( ( ) ) ,
265265 ( _, false , _) => Err ( ExprError :: UnmatchedOpeningBrace ) ,
266266 ( false , _, _) => Err ( ExprError :: UnmatchedOpeningParenthesis ) ,
267- ( true , true , true ) => Err ( ExprError :: InvalidContent ( r"\{\}" . to_string ( ) ) ) ,
267+ ( true , true , true ) => Err ( ExprError :: InvalidBracketContent ) ,
268268 }
269269}
270270
@@ -601,7 +601,7 @@ pub fn is_truthy(s: &NumOrStr) -> bool {
601601#[ cfg( test) ]
602602mod test {
603603 use crate :: ExprError ;
604- use crate :: ExprError :: InvalidContent ;
604+ use crate :: ExprError :: InvalidBracketContent ;
605605
606606 use super :: { check_posix_regex_errors, AstNode , BinOp , NumericOp , RelationOp , StringOp } ;
607607
@@ -795,7 +795,7 @@ mod test {
795795 fn check_regex_empty_repeating_pattern ( ) {
796796 assert_eq ! (
797797 check_posix_regex_errors( "ab\\ {\\ }" ) ,
798- Err ( InvalidContent ( r"\{\}" . to_string ( ) ) )
798+ Err ( InvalidBracketContent )
799799 )
800800 }
801801
@@ -804,27 +804,27 @@ mod test {
804804 assert_eq ! (
805805 // out of order
806806 check_posix_regex_errors( "ab\\ {1,0\\ }" ) ,
807- Err ( InvalidContent ( r"\{\}" . to_string ( ) ) )
807+ Err ( InvalidBracketContent )
808808 ) ;
809809 assert_eq ! (
810810 check_posix_regex_errors( "ab\\ {1,a\\ }" ) ,
811- Err ( InvalidContent ( r"\{\}" . to_string ( ) ) )
811+ Err ( InvalidBracketContent )
812812 ) ;
813813 assert_eq ! (
814814 check_posix_regex_errors( "ab\\ {a,3\\ }" ) ,
815- Err ( InvalidContent ( r"\{\}" . to_string ( ) ) )
815+ Err ( InvalidBracketContent )
816816 ) ;
817817 assert_eq ! (
818818 check_posix_regex_errors( "ab\\ {a,b\\ }" ) ,
819- Err ( InvalidContent ( r"\{\}" . to_string ( ) ) )
819+ Err ( InvalidBracketContent )
820820 ) ;
821821 assert_eq ! (
822822 check_posix_regex_errors( "ab\\ {a,\\ }" ) ,
823- Err ( InvalidContent ( r"\{\}" . to_string ( ) ) )
823+ Err ( InvalidBracketContent )
824824 ) ;
825825 assert_eq ! (
826826 check_posix_regex_errors( "ab\\ {,b\\ }" ) ,
827- Err ( InvalidContent ( r"\{\}" . to_string ( ) ) )
827+ Err ( InvalidBracketContent )
828828 ) ;
829829 }
830830}
0 commit comments