Skip to content

Commit

Permalink
debug option
Browse files Browse the repository at this point in the history
  • Loading branch information
taiyoh committed Jul 19, 2009
1 parent 2ca22c1 commit 418e9b8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion t/cmd.t
Expand Up @@ -43,7 +43,7 @@ do {
};

do {
my $cmd = Algorithm::Bayon::Cmd->new( number => 3, debug => 1 );
my $cmd = Algorithm::Bayon::Cmd->new( number => 3 );
$cmd->run("$FindBin::Bin/test_data.tsv");
ok($cmd->stdout);
#diag $cmd->stdout;
Expand Down
8 changes: 4 additions & 4 deletions t/cmd_classify.t
Expand Up @@ -19,7 +19,7 @@ do {
my $args_str = "file => '/tmp/classify_cmd.tsv', inv_keys => 5, inv_size => 150";
diag $args_str;
my %a = eval "($args_str)";
my $cmd = Algorithm::Bayon::CmdClassify->new(%a, debug => 1 );
my $cmd = Algorithm::Bayon::CmdClassify->new(%a);
my $args = join ' ', $cmd->build_command;
is( $args, q{--classify=/tmp/classify_cmd.tsv --inv-keys=5 --inv-size=150 --classify-size=20});
};
Expand All @@ -29,12 +29,12 @@ do {
diag $args_str;
my %a = eval "($args_str)";

my $_cmd = Algorithm::Bayon::Cmd->new( number => 3, debug => 1, clvector => $a{file} );
my $_cmd = Algorithm::Bayon::Cmd->new( number => 3, clvector => $a{file} );
$_cmd->run("$FindBin::Bin/test_data.tsv");
my $file = Algorithm::Bayon::File->new( debug => 1 );
my $file = Algorithm::Bayon::File->new;
my $filename = $file->to_file(sub { print $_ $_cmd->stdout });

my $cmd = Algorithm::Bayon::CmdClassify->new( %a, debug => 1 );
my $cmd = Algorithm::Bayon::CmdClassify->new( %a );
$cmd->run("$FindBin::Bin/test_data.tsv");
ok($cmd->stdout);
unlink '/tmp/classify_cmd.tsv';
Expand Down
6 changes: 3 additions & 3 deletions t/file.t
Expand Up @@ -9,13 +9,13 @@ BEGIN {
use_ok "Algorithm::Bayon::File";
}

my $cmd = Algorithm::Bayon::Cmd->new( number => 3, debug => 1 );
my $cmd = Algorithm::Bayon::Cmd->new( number => 3 );
$cmd->run("$FindBin::Bin/test_data.tsv");

my $dumped_tsv = $cmd->stdout;

do {
my $file = Algorithm::Bayon::File->new( debug => 1 );
my $file = Algorithm::Bayon::File->new;
my @labels = qw/foo bar baz/;
my $data_list = [
[qw/1 a 2 b 3 c/],
Expand All @@ -32,7 +32,7 @@ _TSV_
};

do {
my $file = Algorithm::Bayon::File->new( debug => 1 );
my $file = Algorithm::Bayon::File->new;
my $data_list = [
[qw/1 a 2 b 3 c/],
[qw/4 d 5 e 6 f/],
Expand Down
8 changes: 4 additions & 4 deletions t/module.t
Expand Up @@ -33,7 +33,7 @@ my $data3 = {
};

do {
my $bayon = Algorithm::Bayon->new( debug => 1 );
my $bayon = Algorithm::Bayon->new;
$bayon->number(3);

my $result = $bayon->cluster( data => $data, labels => \@label );
Expand All @@ -44,7 +44,7 @@ do {
};

do {
my $bayon = Algorithm::Bayon->new( debug => 1 );
my $bayon = Algorithm::Bayon->new;
$bayon->number(3);

my $result = $bayon->cluster( data => $data2, labels => \@label );
Expand All @@ -54,7 +54,7 @@ do {

do {

my $bayon = Algorithm::Bayon->new( debug => 1 );
my $bayon = Algorithm::Bayon->new;
$bayon->number(3);

my $result = $bayon->cluster( data => $data3 );
Expand All @@ -69,7 +69,7 @@ do {

do {
# TODO: やっぱりインターフェイスがあまりよくない気が…
my $bayon = Algorithm::Bayon->new( debug => 1 );
my $bayon = Algorithm::Bayon->new;
$bayon->number(3);
$bayon->clvector('/tmp/classify.tsv');

Expand Down
3 changes: 0 additions & 3 deletions t/result.t
Expand Up @@ -17,7 +17,6 @@ my $dumped_tsv = $cmd->stdout;

do {
my $result = Algorithm::Bayon::Result->new(
debug => 1,
point => 0,
raw => $dumped_tsv,
input => "$FindBin::Bin/test_data.tsv"
Expand All @@ -34,7 +33,6 @@ do {

do {
my $result = Algorithm::Bayon::Result->new(
debug => 1,
point => 0,
raw => $dumped_tsv,
input => "$FindBin::Bin/test_data.tsv",
Expand All @@ -48,7 +46,6 @@ do {

do {
my $result = Algorithm::Bayon::Result->new(
debug => 1,
point => 0,
raw => $dumped_tsv,
input => "$FindBin::Bin/test_data.tsv",
Expand Down

0 comments on commit 418e9b8

Please sign in to comment.