use note instead of diag in tests for non-error debug output

This commit is contained in:
Graham Knop 2009-09-23 08:29:05 -05:00
parent 929c012075
commit 67b729fee0
30 changed files with 50 additions and 50 deletions

View file

@ -184,12 +184,12 @@ is(
#
####################################################
#diag $snippets[0]->get('lineage');
#diag $snippet2->get('lineage');
#note $snippets[0]->get('lineage');
#note $snippet2->get('lineage');
##Uncomment me to crash the test
#$snippet2->cascadeLineage($snippets[0]->get('lineage'));
#diag $snippets[0]->get('lineage');
#diag $snippet2->get('lineage');
#note $snippets[0]->get('lineage');
#note $snippet2->get('lineage');
####################################################
#

View file

@ -43,7 +43,7 @@ my $originalVersionTags = $session->db->quickScalar(q{select count(*) from asset
#
################################################################
diag "purgeRevision tests";
note "purgeRevision tests";
my $template = $root->addChild($propertyHash);
$template->commit;
@ -93,7 +93,7 @@ $templatev2 = $template->addRevision({template => 'Vie gates. Ich bin ein templ
my $tag2 = WebGUI::VersionTag->getWorking($session);
$tag2->commit;
WebGUI::Test->tagsToRollback($tag2);
diag "purge";
note "purge";
checkTableEntries($templatev2->getId, 1,2,2);
$versionTagCheck = $session->db->quickScalar(q{select count(*) from assetVersionTag});
is($versionTagCheck, $originalVersionTags+2, 'created two version tags');

View file

@ -69,7 +69,8 @@ ok(
eval{ $photo->makeResolutions; 1 },
"makeResolutions succeeds when photo under photo gallery and no resolution given",
);
diag( $@ );
diag( $@ )
if $@;
cmp_deeply(
$photo->getStorageLocation->getFiles,
@ -121,7 +122,8 @@ ok(
eval{ $photo->makeResolutions(['100x100','200x200']); 1 },
"makeResolutions succeeds when first argument is array reference of resolutions to make",
);
diag( $@ );
diag( $@ )
if $@;
is_deeply(
[ sort({ $a cmp $b} @{ $photo->getStorageLocation->getFiles }) ],
@ -194,7 +196,8 @@ $photo->update({ filename => 'page_title.jpg' });
eval{ $photo->makeResolutions(['abc','200','3d400']); 1 },
"makeResolutions succeeds when invalid resolutions are given",
);
diag( $@ );
diag( $@ )
if $@;
is(
scalar @warnings, 2,

View file

@ -344,7 +344,7 @@ cmp_deeply(
'...collateral was removed'
);
diag $asset->getId;
note $asset->getId;
$tag->rollback;

View file

@ -324,7 +324,7 @@ $story->setPhotoData([
my $viewVariables = $story->viewTemplateVariables;
#diag Dumper $viewVariables;
#note explain $viewVariables;
cmp_deeply(
$viewVariables->{highlights_loop},
[

View file

@ -219,9 +219,9 @@ is(scalar @{ $windowCal->getLineage(['children'])}, 9, 'added events to the wind
my @window = $windowCal->getEventsIn($startDt->toDatabase, $endDt->toDatabase);
#diag $startDt->toDatabase;
#diag join "\n", map { join ' ', $_->get('title'), $_->get('startDate'), $_->get('startTime')} @window;
#diag $endDt->toDatabase;
#note $startDt->toDatabase;
#note join "\n", map { join ' ', $_->get('title'), $_->get('startDate'), $_->get('startTime')} @window;
#note $endDt->toDatabase;
is(scalar @window, 4, 'getEventsIn returned 4 events');
cmp_bag(

View file

@ -94,7 +94,7 @@ $post = $collab->addChild($props,
my $rssitems = $collab->getRssFeedItems();
is(scalar @{ $rssitems }, 2, 'rssitems set to number of posts added');
diag "AssetAspect tests";
note "AssetAspect tests";
is($collab->getRssFeedUrl, '/collab?func=viewRss', 'getRssFeedUrl');
is($collab->getRdfFeedUrl, '/collab?func=viewRdf', 'getRdfFeedUrl');
is($collab->getAtomFeedUrl, '/collab?func=viewAtom', 'getAtomFeedUrl');

View file

@ -50,8 +50,8 @@ my $album
{
skipAutoCommitWorkflows => 1,
});
diag $album->get('title');
diag $album->get('description');
note $album->get('title');
note $album->get('description');
my @photos;
for my $i ( 0 .. 5 ) {
$photos[ $i ]

View file

@ -106,7 +106,7 @@ my $uploadsPath = Path::Class::Dir->new($session->config->get('uploadsPath'));
my $uploadsUrl = Path::Class::Dir->new($session->config->get('uploadsURL'));
my $graphRelative = $graphUrl->relative($uploadsUrl);
my $graphFile = $uploadsPath->file($graphRelative);
diag $graphFile->stringify;
note $graphFile->stringify;
ok(-e $graphFile->stringify, 'graph exists');

View file

@ -237,7 +237,7 @@ is(WebGUI::DatabaseLink->new($session,'foobar'), undef, 'new returns undef with
#
####################################################
diag 'queryIsValid';
note 'queryIsValid';
foreach my $query (@{ $queries }) {
is($dbLink->queryIsAllowed($query->{query}), $query->{expect}, $query->{comment});
}

View file

@ -118,7 +118,7 @@ is($input->value, 'WebGUI::Storage', 'Checking default value');
##Test Form Output parsing
#diag $formType;
#note $formType;
WebGUI::Form_Checking::auto_check($session, $formType, $testBlock);
#

View file

@ -36,5 +36,5 @@ my $form = WebGUI::Form::DynamicField->new($session,
fieldType => 'FormTest',
);
diag "Test loading a Form from a location outside of /data/WebGUI/lib/WebGUI";
note "Test loading a Form from a location outside of /data/WebGUI/lib/WebGUI";
isa_ok($form, 'WebGUI::Form::FormTest');

View file

@ -107,7 +107,7 @@ foreach my $testSet (@testArray) {
$testSet->{comment}
);
if (!$ok) {
diag Dumper \@output;
diag explain \@output;
}
}

View file

@ -128,8 +128,8 @@ is(scalar @{ $inbox->getMessagesForUser($admin, '', '', '', 'sentBy='.$session->
is($inbox->getUnreadMessageCount($admin->userId), 4, 'getUnreadMessageCount');
my $messages = $inbox->getMessagesForUser($admin);
$messages->[0]->setRead($admin->userId);
diag $messages->[0]->getStatus;
diag $messages->[0]->isRead;
note $messages->[0]->getStatus;
note $messages->[0]->isRead;
is($inbox->getUnreadMessageCount($admin->userId), 3, '... really tracks unread messages');
END {

View file

@ -62,4 +62,4 @@ WHOLE: for (my $i=0; $i<=999; $i++) {
is(scalar(@bins), 4, "All bins have values on a sample size of 1000");
#diag Dumper \@bins;
#note explain \@bins;

View file

@ -170,7 +170,7 @@ cmp_deeply(
}),
},
"Success response contains new users information",
) or diag( Dumper $responseObj );
) or diag explain $responseObj;
$userRed = WebGUI::User->new( $session, $responseObj->{user}->{userId} );
is( $userRed->get("username"), "EBRedding", "User exists and username is correct" );
$auth = WebGUI::Operation::Auth::getInstance( $session, 'WebGUI', $userRed->getId );
@ -311,7 +311,7 @@ cmp_deeply(
}),
},
"Success response contains new users information",
) or diag( Dumper $responseObj );
) or diag explain $responseObj;
$userRed = WebGUI::User->new( $session, $responseObj->{user}->{userId} );
is( $userRed->get("username"), "EBRedding", "User exists and username is correct" );
$auth = WebGUI::Operation::Auth::getInstance( $session, 'WebGUI', $userRed->getId );

View file

@ -39,7 +39,7 @@ foreach my $package (sort @modules) {
skip "No subroutines found by Devel::Symdump for $package", 1 if $goodReason;
ok($coverage, sprintf "%s has %d%% POD coverage", $package, $pc->coverage*100);
if (!$coverage && $ENV{POD_COVERAGE}) {
diag Dumper [$pc->naked];
diag explain [$pc->naked];
diag $pc->why_unrated;
}
}

View file

@ -23,7 +23,7 @@ File::Find::find( \&getWebGUIModules, $wgLib);
plan tests => scalar(@modules);
#diag("Planning on ".scalar(@modules)." tests");
#note("Planning on ".scalar(@modules)." tests");
my %options;
$options{-warnings} = 0; # report only errors for now

View file

@ -121,7 +121,7 @@ END {
$session->scratch->deleteAll;
foreach my $wgSess ($newSession, @sessionBank) {
if (defined $wgSess and ref $wgSess eq 'WebGUI::Session') {
diag "Closing session";
note "Closing session";
$wgSess->scratch->deleteAll;
$wgSess->var->end;
$wgSess->close;

View file

@ -40,7 +40,7 @@ plan tests => 1 + $tests;
#----------------------------------------------------------------------------
# figure out if the test can actually run
diag('Testing existence');
note('Testing existence');
my $loaded = use_ok('WebGUI::Shop::PayDriver::ITransact');
my $e;
@ -96,7 +96,7 @@ skip 'Unable to load module WebGUI::Shop::PayDriver::ITransact', $tests unless $
#
#######################################################################
diag('Testing definition');
note('Testing definition');
my $definition;
eval { $definition = WebGUI::Shop::PayDriver::ITransact->definition(); };
@ -294,7 +294,7 @@ TODO: {
SKIP: {
skip "Skipping XML requests to ITransact due to lack of userId and password", 2 unless $hasTestAccount;
my $response = eval { $driver->doXmlRequest($xml) };
diag 'doXmlrequest';
note 'doXmlrequest';
isa_ok($response, 'HTTP::Response', 'returns a HTTP::Response object');
ok( $response->is_success, '... was successful');
}
@ -313,7 +313,7 @@ SKIP: {
my $response = eval { $driver->doXmlRequest($xml) };
isa_ok($response, 'HTTP::Response', 'returns a HTTP::Response object');
ok( $response->is_success, '... was successful');
diag $response->content;
note $response->content;
}
#######################################################################

View file

@ -39,7 +39,7 @@ plan tests => 1 + $tests;
my $e;
diag('Testing existence');
note('Testing existence');
my $loaded = use_ok('WebGUI::Shop::PayDriver::Ogone');
SKIP: {
@ -52,7 +52,7 @@ skip 'Unable to load module WebGUI::Shop::PayDriver::Ogone', $tests unless $load
#
#######################################################################
diag('Testing definition');
note('Testing definition');
my $definition;
eval { $definition = WebGUI::Shop::PayDriver::Ogone->definition(); };

View file

@ -357,8 +357,7 @@ cmp_deeply(
isa_ok( $driver->get(), 'HASH', 'get returns a hashref if called with no param');
use Data::Dumper;
diag Dumper $driver->get();
note explain $driver->get();
is($driver->get('groupToUse'), 7, '... default group is 7');

View file

@ -81,4 +81,4 @@ my $template1 = $root->addChild($tProperties1);
$tag->commit;
diag "Done.";
note "Done.";

View file

@ -54,7 +54,7 @@ my $properties1 = {
my $root = WebGUI::Asset->getRoot($session);
my $product1 = $root->addChild($properties1);
diag ref $product1;
note ref $product1;
my $properties2 = {
className => 'WebGUI::Asset::Wobject::Product',
@ -67,7 +67,7 @@ my $properties2 = {
my $product2 = $root->addChild($properties2);
diag ref $product2;
note ref $product2;
$tag->commit;
sleep 2;
@ -185,4 +185,4 @@ $productb->setCollateral('Product_benefit', 'Product_benefitId', {
$tag->commit;
diag "Done.";
note "Done.";

View file

@ -322,7 +322,7 @@ cmp_bag($s3copy->getFiles(), [ @filesToCopy ], 'copy: passing explicit variable
my $deepDeepDir = $deepDir->subdir('deep');
my $errorStr;
my @foo = $deepDeepDir->mkpath({ error => \$errorStr } );
diag Dumper \@foo;
note explain \@foo;
$deepStorage->addFileFromScalar('deep/file', 'deep file');
cmp_bag(
$deepStorage->getFiles('all'),

View file

@ -50,8 +50,6 @@ ok($jsonText, 'The file is not empty');
my $perlScalar;
eval { $perlScalar = JSON->new->relaxed(1)->decode($jsonText) };
diag $@;
if ($@) {
my $index;
($index) = $@ =~ /character offset (\d+)/;

View file

@ -52,8 +52,8 @@ my $origSessionTimeout = $session->setting->get('sessionTimeout');
my $sessionCount = $session->db->quickScalar('select count(*) from userSession');
my $scratchCount = $session->db->quickScalar('select count(*) from userSessionScratch');
diag $sessionCount;
diag $scratchCount;
note $sessionCount;
note $scratchCount;
my @sessions;

View file

@ -29,7 +29,7 @@ my $lib = WebGUI::Test->lib;
##Find the name of the International macro in the user's config file.
#diag "International macro name = $international";
#note "International macro name = $international";
##Regexp setup for parsing out the Macro calls.
my $macro = qr{

View file

@ -161,7 +161,7 @@ foreach my $tmpl (@tmplVarTable) {
plan tests => $numTests;
#diag("planning on $numTests tests");
#note("planning on $numTests tests");
foreach my $tmpl ( @tmplVarTable ) {
my $tmplId = $tmpl->{id};

View file

@ -30,7 +30,7 @@ my $lib = WebGUI::Test->lib;
##Find the name of the International macro in the user's config file.
#diag "International macro name = $international";
#note "International macro name = $international";
##Regexp setup for parsing out the Macro calls.
my $macro = qr{