@@ -969,73 +969,64 @@ fn test_parse_edition_range() {
969
969
assert_eq ! ( Some ( EditionRange :: Exact ( y( 2024 ) ) ) , parse_edition_range( "edition: 2024 " ) ) ;
970
970
assert_eq ! ( Some ( EditionRange :: Exact ( Edition :: Future ) ) , parse_edition_range( "edition: future" ) ) ;
971
971
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 .. " ) ) ;
972
975
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 ) ) ,
986
977
parse_edition_range( "edition: future.. " )
987
978
) ;
988
979
989
980
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 ) } ) ,
991
982
parse_edition_range( "edition: 2018..2024" )
992
983
) ;
993
984
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 ) } ) ,
995
986
parse_edition_range( "edition:2015 .. 2021 " )
996
987
) ;
997
988
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 ) } ) ,
999
990
parse_edition_range( "edition: 2021 .. 2027 " )
1000
991
) ;
1001
992
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 } ) ,
1003
994
parse_edition_range( "edition: 2021..future" )
1004
995
) ;
1005
996
}
1006
997
1007
998
#[ test]
1008
- #[ should_panic = "empty directive value detected" ]
999
+ #[ should_panic]
1009
1000
fn test_parse_edition_range_empty ( ) {
1010
1001
parse_edition_range ( "edition:" ) ;
1011
1002
}
1012
1003
1013
1004
#[ test]
1014
- #[ should_panic = "'hello' doesn't look like an edition" ]
1005
+ #[ should_panic]
1015
1006
fn test_parse_edition_range_invalid_edition ( ) {
1016
1007
parse_edition_range ( "edition: hello" ) ;
1017
1008
}
1018
1009
1019
1010
#[ test]
1020
- #[ should_panic = "'..' is not a supported range in //@ edition" ]
1011
+ #[ should_panic]
1021
1012
fn test_parse_edition_range_double_dots ( ) {
1022
1013
parse_edition_range ( "edition: .." ) ;
1023
1014
}
1024
1015
1025
1016
#[ test]
1026
- #[ should_panic = "the left side of `//@ edition` cannot be higher than the right side" ]
1017
+ #[ should_panic]
1027
1018
fn test_parse_edition_range_inverted_range ( ) {
1028
1019
parse_edition_range ( "edition: 2021..2015" ) ;
1029
1020
}
1030
1021
1031
1022
#[ test]
1032
- #[ should_panic = "the left side of `//@ edition` cannot be higher than the right side" ]
1023
+ #[ should_panic]
1033
1024
fn test_parse_edition_range_inverted_range_future ( ) {
1034
1025
parse_edition_range ( "edition: future..2015" ) ;
1035
1026
}
1036
1027
1037
1028
#[ test]
1038
- #[ should_panic = "the left side of `//@ edition` cannot be equal to the right side" ]
1029
+ #[ should_panic]
1039
1030
fn test_parse_edition_range_empty_range ( ) {
1040
1031
parse_edition_range ( "edition: 2021..2021" ) ;
1041
1032
}
@@ -1062,15 +1053,15 @@ fn test_edition_range_edition_to_test() {
1062
1053
1063
1054
assert_edition_to_test ( Edition :: Future , EditionRange :: Exact ( Edition :: Future ) , None ) ;
1064
1055
1065
- let greater_equal_than = EditionRange :: GreaterEqualThan ( y ( 2021 ) ) ;
1056
+ let greater_equal_than = EditionRange :: RangeFrom ( y ( 2021 ) ) ;
1066
1057
assert_edition_to_test ( 2021 , greater_equal_than, None ) ;
1067
1058
assert_edition_to_test ( 2021 , greater_equal_than, Some ( "2015" ) ) ;
1068
1059
assert_edition_to_test ( 2021 , greater_equal_than, Some ( "2018" ) ) ;
1069
1060
assert_edition_to_test ( 2021 , greater_equal_than, Some ( "2021" ) ) ;
1070
1061
assert_edition_to_test ( 2024 , greater_equal_than, Some ( "2024" ) ) ;
1071
1062
assert_edition_to_test ( Edition :: Future , greater_equal_than, Some ( "future" ) ) ;
1072
1063
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 ) } ;
1074
1065
assert_edition_to_test ( 2018 , range, None ) ;
1075
1066
assert_edition_to_test ( 2018 , range, Some ( "2015" ) ) ;
1076
1067
assert_edition_to_test ( 2018 , range, Some ( "2018" ) ) ;
@@ -1080,7 +1071,7 @@ fn test_edition_range_edition_to_test() {
1080
1071
}
1081
1072
1082
1073
#[ test]
1083
- #[ should_panic = "'not an edition' doesn't look like an edition" ]
1074
+ #[ should_panic]
1084
1075
fn test_edition_range_edition_to_test_bad_cli ( ) {
1085
1076
assert_edition_to_test ( 2021 , EditionRange :: Exact ( y ( 2021 ) ) , Some ( "not an edition" ) ) ;
1086
1077
}
0 commit comments