File: no_side_effects.t

package info (click to toggle)
libdbix-class-resultset-recursiveupdate-perl 0.45-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,060 kB
  • sloc: perl: 5,130; sql: 640; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 796 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;
use Test::More;
use Test::Exception;
use lib qw(t/lib);
use DBSchema;

my $schema     = DBSchema->get_test_schema();
my $podcast_rs = $schema->resultset('Podcast');

{
    my $ret1 = DBIx::Class::ResultSet::RecursiveUpdate::Functions::_master_relation_cond( $podcast_rs, 'owner' );
    my $ret2 = DBIx::Class::ResultSet::RecursiveUpdate::Functions::_master_relation_cond( $podcast_rs, 'owner' );
    is $ret1, $ret2, "no side effects";
}

{
    my $before = join ',', sort keys %{$podcast_rs->result_source->column_info('id')};
    DBIx::Class::ResultSet::RecursiveUpdate::Functions::_get_columns_by_accessor($podcast_rs);
    my $after  = join ',', sort keys %{$podcast_rs->result_source->column_info('id')};
    is $before, $after, "no side effects";
}

done_testing;