diff --git a/Testing/TableTest.h b/Testing/TableTest.h index 26a3e4f..b956b1e 100644 --- a/Testing/TableTest.h +++ b/Testing/TableTest.h @@ -165,8 +165,9 @@ namespace Alepha::Hydrogen::Testing ::detail:: TableTest_m } {} + template< typename ... Params > std::tuple< TestResult, std::optional< std::string > > - operator() ( Invoker invoker, const std::string &comment ) const + operator() ( Invoker invoker, const std::string &comment, const std::tuple< Params... > params ) const { if( impl != nullptr ) return impl( invoker, comment ); if constexpr( std::is_base_of_v< std::decay_t< return_type >, ComputedBase > ) @@ -202,6 +203,14 @@ namespace Alepha::Hydrogen::Testing ::detail:: TableTest_m streamDebugging< outputMode >( oss, std::get< return_type >( witness ), expected ); } else oss << "Unexpected exception of type: " << std::get< ErrorMessage >( witness ).mesg; + + oss << std::endl << "Test inputs were: " << std::endl; + int index= 0; + tuple_for_each( params ) <=[&]( const auto ¶m ) + { + // Debugging output for test inputs is relaxed, as it's not required they be streamable? + oss << "Argument " << index++ << ": " << streamAdaptValue< OutputMode::Relaxed >( param ) << std::endl; + }; } return { result, oss.str().empty() ? std::optional< std::string >{} : std::move( oss ).str() }; } @@ -472,7 +481,7 @@ namespace Alepha::Hydrogen::Testing ::detail:: TableTest_m }; const auto checker= [=]( const auto comment ) { - return handler( invoker, comment ); + return handler( invoker, comment, params ); }; if( comment.state == CaseComment::Enabled ) {