);
isa_ok( $_ => 'DS::Transformer::Buffer' );
eval {
$_->fetch;
};
isnt( $@, '', 'Should not allow fetching from empty buffer' );
my $importer = new ImporterTest(
$debugger->attach_target( new DS::Target::Sink );
eval {
$_->fetch;
};
isnt( $@, '', 'Should not allow fetching from empty buffer' );
is( $last, 'nothing yet' );
wmap( $_->fetch ), 'count = "4" modulo_3 = "1"' );
eval {
$_->fetch;
};
isnt( $@, '', 'Should not allow fetching past last available row in buffer' );
for( my $i =
new DS::TypeSpec::Field( 'pk2' )]
);
my $source = new DS::Source();
for( $source ) {
isnt( $_, undef );
isa_ok( $_, 'DS::Source');
is( $_->target, undef );
is( $_->out_type
isnt( $@, undef );
eval {
$_->in_type( 'something invalid' );
};
isnt( $@, undef );
eval {
$_->attach_target( 'something invalid' );
};
isnt( $@
new DS::TypeSpec::Field( 'pk2' )]
);
my $target = new DS::Target();
for( $target ) {
isnt( $_, undef );
isa_ok( $_, 'DS::Target');
is( $_->source, undef );
is( $_->in_type,
isnt( $@, undef );
eval {
$_->in_type( 'something invalid' );
};
isnt( $@, undef );
eval {
$_->attach_source( 'something invalid' );
};
isnt(
peSpec' );
use_ok( 'DS::TypeSpec::Field' );
my $field = new DS::TypeSpec::Field( 'test' );
isnt( $field, undef );
isa_ok( $field, 'DS::TypeSpec::Field' );
is( $field->{name}, 'test' );
eld( 'another_field' ),
new DS::TypeSpec::Field( 'pk2' )]
);
for( $typespec ) {
isnt( $_, undef );
isa_ok( $_, 'DS::TypeSpec' );
is( $_->{name}, 'mytype' );
is_d
my $typespec = $typespec->project( 'p_type', $field_superset );
ok( not $typespec );
};
isnt( $@, undef );
# Check that asking for non existing fields results in an error
my $field_incom
_->in_type( $typespec );
};
isnt( $@, '', 'Setting in_type should throw exception' );
eval {
$_->out_type( $typespec );
};
isnt( $@, '', 'Setting out_type should th
$_->attach_source( $source );
eval {
$_->attach_target( $target );
};
isnt( $@, '' );
# Start over with a new pt transformer
$_ = new DS::Transformer::TypePasst
hrough;
$_->attach_target( $target );
eval {
$_->attach_source( $source );
};
isnt( $@, '' );
}
count => 1} );
$importer->pass_row( $importer->_fetch() );
is( $counter->{row}->{count}, 2);
isnt( $counter->{eos}, 1);
$importer->execute();
is( $importer->{counter}, 11 );
is( $counter->
main::is( ref( $row ), 'HASH' );
# Check that count has been set
main::isnt( $row->{count}, undef );
# Check that the counter has increased since last call
l_target} );
is( $stack->{internal_target}->source, $trace_inside );
isnt( $trace_inside->source, $trace_before );
isnt( $trace_inside->target, $trace_after );
eval {
$importer->execute