-
Notifications
You must be signed in to change notification settings - Fork 13
/
merge.t
49 lines (36 loc) · 1.21 KB
/
merge.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use 5.10.0;
use strict;
use warnings;
use Test::More;
use Seq::Tracks::Build;
# create temp directories
my $db_dir = Path::Tiny->tempdir();
my $files_dir = Path::Tiny->tempdir();
Seq::DBManager::initialize( { databaseDir => $db_dir } );
my $t = Seq::Tracks::Build->new(
{
files_dir => $db_dir,
name => 'test',
type => 'sparse',
chromosomes => ['testChr'],
assembly => 'hgTest'
}
);
my ( $mergeFunc, $cleanUp ) = $t->makeMergeFunc();
my @testVals = ( 67, 45, 22, 35 );
my @testVals2 = ( 33, 25, 21, 65 );
my $chr = 'testChr';
my $pos = 1;
my ( $err, $result ) = $mergeFunc->( $chr, $pos, \@testVals, \@testVals2 );
ok( join( ',', @{ $result->[0] } ) eq join( ',', 67, 33 ) );
ok( join( ',', @{ $result->[1] } ) eq join( ',', 45, 25 ) );
ok( join( ',', @{ $result->[2] } ) eq join( ',', 22, 21 ) );
ok( join( ',', @{ $result->[3] } ) eq join( ',', 35, 65 ) );
# @testVals2 = (3334, 225, 201, 605,777, 888);
# ($err, $result) = $mergeFunc->($chr, $pos, $result, \@testVals2);
# p $result;
# # ok(join(',', @{$result->[0]} eq join(',', 67)));
# @testVals2 = ('short1', 'short2');
# ($err, $result) = $mergeFunc->($chr, $pos, $result, \@testVals2);
$t->db->cleanUp();
done_testing();