#!/bin/env perl

=pod

=head1 NAME

test_cover - driver script to illustrate extract_cover method in Set::IntSpan::Island

=head1 SYNOPSIS

Just run it.

=head1 DESCRIPTION

=head1 AUTHOR

Martin Krzywinski <martink@bcgsc.ca>

=cut

use strict;
use FindBin;
use lib "$FindBin::Bin/../blib/lib";
use Set::IntSpan::Island 0.02;

my $sets = {};

$sets->{a} = Set::IntSpan::Island->new("0-1,3-5");
$sets->{b} = Set::IntSpan::Island->new("2-6,8-9");

my $cover_data = Set::IntSpan::Island->extract_covers($sets);

for my $cover (@$cover_data) {
    my ($set,$ids) = @$cover;
    my $depth = @$ids;
    printf("cover %4d %4d %4d depth %3d ids %s\n",$set->min,$set->max,$set->size,$depth,join(":",@$ids));
}



