@@ -38,28 +38,41 @@ use type_generation::{intersection, union};
3838///
3939/// where `t1`, `t2`, ..., `tn` are identifiers that represent arbitrary types, and `<property>`
4040/// is an expression using these identifiers.
41- ///
4241macro_rules! type_property_test {
4342 ( $test_name: ident, $db: ident, forall types $( $types: ident) ,+ . $property: expr) => {
4443 #[ quickcheck_macros:: quickcheck]
4544 #[ ignore]
4645 fn $test_name( $( $types: crate :: types:: property_tests:: type_generation:: Ty ) ,+) -> bool {
4746 let $db = & crate :: types:: property_tests:: setup:: get_cached_db( ) ;
4847 $( let $types = $types. into_type( $db) ; ) +
48+ let result = $property;
49+
50+ if !result {
51+ println!( "\n Failing types were:" ) ;
52+ $( println!( "{}" , $types. display( $db) ) ; ) +
53+ }
4954
50- $property
55+ result
5156 }
5257 } ;
58+
5359 ( $test_name: ident, $db: ident, forall fully_static_types $( $types: ident) ,+ . $property: expr) => {
5460 #[ quickcheck_macros:: quickcheck]
5561 #[ ignore]
5662 fn $test_name( $( $types: crate :: types:: property_tests:: type_generation:: FullyStaticTy ) ,+) -> bool {
5763 let $db = & crate :: types:: property_tests:: setup:: get_cached_db( ) ;
5864 $( let $types = $types. into_type( $db) ; ) +
65+ let result = $property;
5966
60- $property
67+ if !result {
68+ println!( "\n Failing types were:" ) ;
69+ $( println!( "{}" , $types. display( $db) ) ; ) +
70+ }
71+
72+ result
6173 }
6274 } ;
75+
6376 // A property test with a logical implication.
6477 ( $name: ident, $db: ident, forall $typekind: ident $( $types: ident) ,+ . $premise: expr => $conclusion: expr) => {
6578 type_property_test!( $name, $db, forall $typekind $( $types) ,+ . !( $premise) || ( $conclusion) ) ;
0 commit comments