File tree Expand file tree Collapse file tree
library/coretests/tests/floats Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1256,6 +1256,48 @@ float_test! {
12561256 }
12571257}
12581258
1259+ float_test ! {
1260+ name: clamp_to_min_greater_than_max,
1261+ attrs: {
1262+ const : #[ cfg( false ) ] ,
1263+ f16: #[ should_panic, cfg( any( miri, target_has_reliable_f16) ) ] ,
1264+ f32 : #[ should_panic] ,
1265+ f64 : #[ should_panic] ,
1266+ f128: #[ should_panic, cfg( any( miri, target_has_reliable_f128) ) ] ,
1267+ } ,
1268+ test<Float > {
1269+ let _ = Float :: ONE . clamp_to( 3.0 ..=1.0 ) ;
1270+ }
1271+ }
1272+
1273+ float_test ! {
1274+ name: clamp_to_min_is_nan,
1275+ attrs: {
1276+ const : #[ cfg( false ) ] ,
1277+ f16: #[ should_panic, cfg( any( miri, target_has_reliable_f16) ) ] ,
1278+ f32 : #[ should_panic] ,
1279+ f64 : #[ should_panic] ,
1280+ f128: #[ should_panic, cfg( any( miri, target_has_reliable_f128) ) ] ,
1281+ } ,
1282+ test<Float > {
1283+ let _ = Float :: ONE . clamp_to( Float :: NAN ..=1.0 ) ;
1284+ }
1285+ }
1286+
1287+ float_test ! {
1288+ name: clamp_to_max_is_nan,
1289+ attrs: {
1290+ const : #[ cfg( false ) ] ,
1291+ f16: #[ should_panic, cfg( any( miri, target_has_reliable_f16) ) ] ,
1292+ f32 : #[ should_panic] ,
1293+ f64 : #[ should_panic] ,
1294+ f128: #[ should_panic, cfg( any( miri, target_has_reliable_f128) ) ] ,
1295+ } ,
1296+ test<Float > {
1297+ let _ = Float :: ONE . clamp_to( 3.0 ..=Float :: NAN ) ;
1298+ }
1299+ }
1300+
12591301float_test ! {
12601302 name: total_cmp,
12611303 attrs: {
You can’t perform that action at this time.
0 commit comments