i am executing below code to achive my result, but for second row the value is not coming
it should come URL like other two . url start with http:// and end with .xhtml
Hi,
i have a function which return a variable .
serach ( paramatere) when i excute this function i get the result in the shell,
i want to print this result in a file by calling just the function.
how can i do it..
the code example is like that:
search ( )
{
..
}
the call... (0 Replies)
i got a data file which contains all the pid,ppid,user,command,pcpu,start_time,status. I wanted to display out the pcpu which is greater than 0.
i uses awk'{if($5 > 0){print}}' filename.txt but is printing out result which not i wanted. Is there any way which i can print out those pcpu which is... (8 Replies)
I'm still beginner and maybe someone can help me.
I have this input:
the great warrior a, b, c
and what i want to know is, with awk, how can i detect the string with 'warrior' string on it and print the a, b, and c seperately, become like this :
Warrior Type
a
b
c
Im still very... (3 Replies)
Hello,
i need help with awk.
I have this file:
cat number
DirB port 67 er_enc_out 0 er_bad_os 0
DirB port 71 er_enc_out 56 er_bad_os 0
DirB port 74 er_enc_out 0 er_bad_os 0
DirB port 75 ... (4 Replies)
Hello....
Pls help me (and sorry my english) :)
So
I have a file (test.txt) with 1 long line.... for example:
isgc jsfh udgf osff 8462 error iwzr 653 idchisfb isfbisfb sihfjfeb isfhsi gcz eifh
How to print after the "error" word the 2nd 4th 5th and 7th word??
output well be:
653 isfbisfb... (2 Replies)
I have a result like this
root@server # grep -rl maldet /etc/cron*
/etc/cron.d/maldet_daily
/etc/cron.d/malcron
/etc/cron.d/malcrondaily
/etc/cron.d/malcronweekly
What I need is, I need an if/else condition such that, if there is any output other than /etc/cron.d/maldet_daily in the... (8 Replies)
I am trying to move files which donot have same filename using
find /Users/ParijatMac/desktop/unix/new_dir -type f -mmin +"$HRS" -exec mv -n "{}" /Users/ParijatMac/desktop/unix/old_dir \; -print
but i am getting all filenames including the ones with duplicate names.Please help me to sort... (5 Replies)
Discussion started by: parijat guh
5 Replies
LEARN ABOUT OSX
test::object
Test::Object(3) User Contributed Perl Documentation Test::Object(3)NAME
Test::Object - Thoroughly testing objects via registered handlers
SYNOPSIS
###################################################################
# In your test module, register test handlers again class names #
###################################################################
package My::ModuleTester;
use Test::More;
use Test::Object;
# Foo::Bar is a subclass of Foo
Test::Object->register(
class => 'Foo',
tests => 5,
code => &foo_ok,
);
Test::Object->register(
class => 'Foo::Bar',
# No fixed number of tests
code => &foobar_ok,
);
sub foo_ok {
my $object = shift;
ok( $object->foo, '->foo returns true' );
}
sub foobar_ok {
my $object = shift;
is( $object->foo, 'bar', '->foo returns "bar"' );
}
1;
###################################################################
# In test script, test object against all registered classes #
###################################################################
#!/usr/bin/perl -w
use Test::More 'no_plan';
use Test::Object;
use My::ModuleTester;
my $object = Foo::Bar->new;
isa_ok( $object, 'Foo::Bar' );
object_ok( $object );
DESCRIPTION
In situations where you have deep trees of classes, there is a common situation in which you test a module 4 or 5 subclasses down, which
should follow the correct behaviour of not just the subclass, but of all the parent classes.
This should be done to ensure that the implementation of a subclass has not somehow "broken" the object's behaviour in a more general
sense.
"Test::Object" is a testing package designed to allow you to easily test what you believe is a valid object against the expected behaviour
of all of the classes in its inheritance tree in one single call.
To do this, you "register" tests (in the form of CODE or function references) with "Test::Object", with each test associated with a
particular class.
When you call "object_ok" in your test script, "Test::Object" will check the object against all registered tests. For each class that your
object responds to "$object->isa($class)" for, the appropriate testing function will be called.
Doing it this way allows adapter objects and other things that respond to "isa" differently that the default to still be tested against the
classes that it is advertising itself as correctly.
This also means that more than one test might be "counted" for each call to "object_ok". You should account for this correctly in your
expected test count.
SUPPORT
Bugs should be submitted via the CPAN bug tracker, located at
http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Object <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Object>
For other issues, contact the author.
AUTHOR
Adam Kennedy <cpan@ali.as>
SEE ALSO
<http://ali.as/>, Test::More, Test::Builder::Tester, Test::Class
COPYRIGHT
Copyright 2005, 2006 Adam Kennedy. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl v5.16.2 2006-09-06 Test::Object(3)