#include "common.hpp" auto mkptr( const path &, int v ) { return std::make_unique< int >( v ); } int deref( const path &, std::unique_ptr< int > p ) { return *p; } int main() { for ( int i = 0; i < vg_select( 1000, 100 ); ++i ) { gen_t gen( i ); gen.max_size = 90; gen.max_depth = 4; gen.max_length = 12; gen.value(); DECLARE( auto q = query( gen.str ) ); DECLARE( auto ptr_id = q.map( int_value ).map( mkptr ).map( deref ) ); DECLARE( auto depth = []( const path &p, int ) { return len( p ); } ); TRACE( json_parse( gen.str ), "gen.str =", gen.str ); ASSERT_FOR_( ptr_id.filter( is_odd ), --gen.i_odd >= 0 ); ASSERT( gen.i_odd == 0, "gen.i_odd =", gen.i_odd ); ASSERT_FOR( ( p, x ), ptr_id.map( []( path, int ) { return 3; } ), x == 3 ); ASSERT_FOR( ( p, x ), ptr_id.map( depth ), len( p ) == x, "p =", format( p ), "x =", x ); CLEAR(); } }