@@ -969,73 +969,64 @@ fn test_parse_edition_range() {
969969 assert_eq ! ( Some ( EditionRange :: Exact ( y( 2024 ) ) ) , parse_edition_range( "edition: 2024 " ) ) ;
970970 assert_eq ! ( Some ( EditionRange :: Exact ( Edition :: Future ) ) , parse_edition_range( "edition: future" ) ) ;
971971
972+ assert_eq ! ( Some ( EditionRange :: RangeFrom ( y( 2018 ) ) ) , parse_edition_range( "edition: 2018.." ) ) ;
973+ assert_eq ! ( Some ( EditionRange :: RangeFrom ( y( 2021 ) ) ) , parse_edition_range( "edition:2021 .." ) ) ;
974+ assert_eq ! ( Some ( EditionRange :: RangeFrom ( y( 2024 ) ) ) , parse_edition_range( "edition: 2024 .. " ) ) ;
972975 assert_eq ! (
973- Some ( EditionRange :: GreaterEqualThan ( y( 2018 ) ) ) ,
974- parse_edition_range( "edition: 2018.." )
975- ) ;
976- assert_eq ! (
977- Some ( EditionRange :: GreaterEqualThan ( y( 2021 ) ) ) ,
978- parse_edition_range( "edition:2021 .." )
979- ) ;
980- assert_eq ! (
981- Some ( EditionRange :: GreaterEqualThan ( y( 2024 ) ) ) ,
982- parse_edition_range( "edition: 2024 .. " )
983- ) ;
984- assert_eq ! (
985- Some ( EditionRange :: GreaterEqualThan ( Edition :: Future ) ) ,
976+ Some ( EditionRange :: RangeFrom ( Edition :: Future ) ) ,
986977 parse_edition_range( "edition: future.. " )
987978 ) ;
988979
989980 assert_eq ! (
990- Some ( EditionRange :: Range { greater_equal_than : y( 2018 ) , lower_than : y( 2024 ) } ) ,
981+ Some ( EditionRange :: Range { lower_bound : y( 2018 ) , upper_bound : y( 2024 ) } ) ,
991982 parse_edition_range( "edition: 2018..2024" )
992983 ) ;
993984 assert_eq ! (
994- Some ( EditionRange :: Range { greater_equal_than : y( 2015 ) , lower_than : y( 2021 ) } ) ,
985+ Some ( EditionRange :: Range { lower_bound : y( 2015 ) , upper_bound : y( 2021 ) } ) ,
995986 parse_edition_range( "edition:2015 .. 2021 " )
996987 ) ;
997988 assert_eq ! (
998- Some ( EditionRange :: Range { greater_equal_than : y( 2021 ) , lower_than : y( 2027 ) } ) ,
989+ Some ( EditionRange :: Range { lower_bound : y( 2021 ) , upper_bound : y( 2027 ) } ) ,
999990 parse_edition_range( "edition: 2021 .. 2027 " )
1000991 ) ;
1001992 assert_eq ! (
1002- Some ( EditionRange :: Range { greater_equal_than : y( 2021 ) , lower_than : Edition :: Future } ) ,
993+ Some ( EditionRange :: Range { lower_bound : y( 2021 ) , upper_bound : Edition :: Future } ) ,
1003994 parse_edition_range( "edition: 2021..future" )
1004995 ) ;
1005996}
1006997
1007998#[ test]
1008- #[ should_panic = "empty directive value detected" ]
999+ #[ should_panic]
10091000fn test_parse_edition_range_empty ( ) {
10101001 parse_edition_range ( "edition:" ) ;
10111002}
10121003
10131004#[ test]
1014- #[ should_panic = "'hello' doesn't look like an edition" ]
1005+ #[ should_panic]
10151006fn test_parse_edition_range_invalid_edition ( ) {
10161007 parse_edition_range ( "edition: hello" ) ;
10171008}
10181009
10191010#[ test]
1020- #[ should_panic = "'..' is not a supported range in //@ edition" ]
1011+ #[ should_panic]
10211012fn test_parse_edition_range_double_dots ( ) {
10221013 parse_edition_range ( "edition: .." ) ;
10231014}
10241015
10251016#[ test]
1026- #[ should_panic = "the left side of `//@ edition` cannot be higher than the right side" ]
1017+ #[ should_panic]
10271018fn test_parse_edition_range_inverted_range ( ) {
10281019 parse_edition_range ( "edition: 2021..2015" ) ;
10291020}
10301021
10311022#[ test]
1032- #[ should_panic = "the left side of `//@ edition` cannot be higher than the right side" ]
1023+ #[ should_panic]
10331024fn test_parse_edition_range_inverted_range_future ( ) {
10341025 parse_edition_range ( "edition: future..2015" ) ;
10351026}
10361027
10371028#[ test]
1038- #[ should_panic = "the left side of `//@ edition` cannot be equal to the right side" ]
1029+ #[ should_panic]
10391030fn test_parse_edition_range_empty_range ( ) {
10401031 parse_edition_range ( "edition: 2021..2021" ) ;
10411032}
@@ -1062,15 +1053,15 @@ fn test_edition_range_edition_to_test() {
10621053
10631054 assert_edition_to_test ( Edition :: Future , EditionRange :: Exact ( Edition :: Future ) , None ) ;
10641055
1065- let greater_equal_than = EditionRange :: GreaterEqualThan ( y ( 2021 ) ) ;
1056+ let greater_equal_than = EditionRange :: RangeFrom ( y ( 2021 ) ) ;
10661057 assert_edition_to_test ( 2021 , greater_equal_than, None ) ;
10671058 assert_edition_to_test ( 2021 , greater_equal_than, Some ( "2015" ) ) ;
10681059 assert_edition_to_test ( 2021 , greater_equal_than, Some ( "2018" ) ) ;
10691060 assert_edition_to_test ( 2021 , greater_equal_than, Some ( "2021" ) ) ;
10701061 assert_edition_to_test ( 2024 , greater_equal_than, Some ( "2024" ) ) ;
10711062 assert_edition_to_test ( Edition :: Future , greater_equal_than, Some ( "future" ) ) ;
10721063
1073- let range = EditionRange :: Range { greater_equal_than : y ( 2018 ) , lower_than : y ( 2024 ) } ;
1064+ let range = EditionRange :: Range { lower_bound : y ( 2018 ) , upper_bound : y ( 2024 ) } ;
10741065 assert_edition_to_test ( 2018 , range, None ) ;
10751066 assert_edition_to_test ( 2018 , range, Some ( "2015" ) ) ;
10761067 assert_edition_to_test ( 2018 , range, Some ( "2018" ) ) ;
@@ -1080,7 +1071,7 @@ fn test_edition_range_edition_to_test() {
10801071}
10811072
10821073#[ test]
1083- #[ should_panic = "'not an edition' doesn't look like an edition" ]
1074+ #[ should_panic]
10841075fn test_edition_range_edition_to_test_bad_cli ( ) {
10851076 assert_edition_to_test ( 2021 , EditionRange :: Exact ( y ( 2021 ) ) , Some ( "not an edition" ) ) ;
10861077}
0 commit comments