Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

test::use::ok(3) [mojave man page]

Test::use::ok(3)					User Contributed Perl Documentation					  Test::use::ok(3)

NAME
Test::use::ok - Alternative to Test::More::use_ok SYNOPSIS
use ok 'Some::Module'; DESCRIPTION
According to the Test::More documentation, it is recommended to run "use_ok()" inside a "BEGIN" block, so functions are exported at compile-time and prototypes are properly honored. That is, instead of writing this: use_ok( 'Some::Module' ); use_ok( 'Other::Module' ); One should write this: BEGIN { use_ok( 'Some::Module' ); } BEGIN { use_ok( 'Other::Module' ); } However, people often either forget to add "BEGIN", or mistakenly group "use_ok" with other tests in a single "BEGIN" block, which can create subtle differences in execution order. With this module, simply change all "use_ok" in test scripts to "use ok", and they will be executed at "BEGIN" time. The explicit space after "use" makes it clear that this is a single compile-time action. SEE ALSO
Test::More CC0 1.0 Universal To the extent possible under law, XX has waived all copyright and related or neighboring rights to Test-use-ok. This work is published from Taiwan. <http://creativecommons.org/publicdomain/zero/1.0> POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 45: Non-ASCII character seen before =encoding in 'XX'. Assuming UTF-8 perl v5.18.2 2012-09-11 Test::use::ok(3)

Check Out this Related Man Page

AutoLoader(3pm) 					User Contributed Perl Documentation					   AutoLoader(3pm)

NAME
Test::AutoLoader - a testing utility for autosplit/autoloaded modules. SYNOPSIS
use Test::AutoLoader; use Test::More tests => 3; use_ok("My::Module"); # from Test::More autoload_ok("My::Module","mysub","sub_two); # test only the listed subs autoload_ok("My::Module"); # tests all '.al' files found for the module DESCRIPTION
This single-purpose module attempts to eliminate uncaught syntax errors or other obvious goofs in subroutines that are autosplit, and hence not looked at by "perl -c Module.pm". Ideally, this module will become unnecessary as you reach full coverage of those subroutines in your unit tests. Until that happy day, however, this should provide a quick and dirty backstop for embarrassing typos. Test::AutoLoader is built on Test::Builder, and should interoperate smoothly with other such modules (e.g. Test::Simple, Test::More). EXPORT
autoload_ok Very much like the 'use_ok' subroutine (see Test::More). If passed only a module name, it will find all subroutine definitions in the "auto" directory and attempt to compile them. If passed a list of subroutine names, it will look for and attempt to compile those (and only those). Any files that cannot be found (if specified directly), read, and compiled will be listed in the diagnostic output for the failed test. AUTHOR
Ben Warfield (ben_warfield@nrgn.com) COPYRIGHT AND LICENSE
This module is copyright (c) 2005 Neurogen Corporation, Branford, Connecticut, USA. It may be distributed under the terms of the GNU General Public License. SEE ALSO
perl, Test::More, AutoLoader. perl v5.10.1 2005-07-22 AutoLoader(3pm)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk question

I have the following error: ls -lt | awk 'BEGIN NR > 1 { print $2, $9 }' Syntax Error The source line is 1. The error context is BEGIN >>> NR <<< > 1 { print $2, $9 } awk: 0602-500 Quitting The source line is 1. What I want to do is ls a directory, skip the first... (3 Replies)
Discussion started by: lesstjm
3 Replies

2. Shell Programming and Scripting

time-out coding in perl

looking for ideas and not answers! to coding a timeout solution in Perl to answer a user prompt. ie, when the program asks whether to execute Y/N and no response is entered, after a time period (maybe 10 seconds) the program will automatically choose yes (or maybe no, whicheva). this isn't... (2 Replies)
Discussion started by: Shakey21
2 Replies

3. Shell Programming and Scripting

How to add a new line into a file

I want to insert a new line character inside the file between these two record entries "san" and "man". How can this be done echo " san " >"C:/\Test/\Output/\Neme" echo " man " >>"C:/\Test/\Output/\Name" Name file should look like this san man Please help (4 Replies)
Discussion started by: sandeep_hi
4 Replies

4. Shell Programming and Scripting

file typ of a file

how can i detect the file typ of a file ? the command "file" is not so useful because it shows only strings (in the example in GERMAN), here some examples : Test for normal file with ASCII strings: file with size zero: create of file: touch touch-zero test of file: file touch-zero... (4 Replies)
Discussion started by: bora99
4 Replies

5. Shell Programming and Scripting

how to make syntax into a korn script??

ok i have this script called script.nawk: BEGIN {print "List\n"} BEGIN {print "AL"} BEGIN {print "AM"} /EAST/ {print $3, $2} END {print "End of Report"} How would I change this so that I don't have to type nawk -f script.nawk filename? Instead just run it as a korn script? thanks! (18 Replies)
Discussion started by: llsmr777
18 Replies

6. UNIX for Advanced & Expert Users

Need help on getting value from a file

I have a file which contains the data like below.It conatins more data than i posted here. BEGIN DSJOB Identifier "TestPart" DateModified "2008-10-08" TimeModified "00.36.32" Identifier "ROOT" DateModified "1899-12-30" TimeModified "00.00.01" OLEType... (6 Replies)
Discussion started by: ukatru
6 Replies

7. Shell Programming and Scripting

AWK not processing BEGIN directive

Hello I have the following awk script: BEGIN { {FS = " " } {print "\t\tIllegal Loggon Attempts on MAIL\n"} {"date" | getline d} {printf "\t %s\n",d } {print "Loggon Name\t\t\t Number of Attempts\n"} ... (2 Replies)
Discussion started by: mojoman
2 Replies

8. Shell Programming and Scripting

Help Required

Below is my code which gives output like this: Every time we have to open the script file and change the value of TG in BEGIN. what i want to do is that i give two three values at the sametime and then run the script and it gives output one by one at the same time. I think i have to define... (2 Replies)
Discussion started by: wakhan
2 Replies

9. Shell Programming and Scripting

BEGIN Clause Help Needed

what does this clause means in UNIX 'BEGIN { FS="|";OFS="|" } the complete clause is like find . -name $filename | xargs awk -v s1=$String1 -v s2=$String2 -v s3=$String3 -v s4=$String4 'BEGIN { FS="|";OFS="|" } Please advice. (2 Replies)
Discussion started by: jojo123
2 Replies

10. Shell Programming and Scripting

control M character in unix file

in a file we are getting control character in a file , is there any way that they can be removed once we have the file for eg. BEGIN-PROCEDURE INITIALIZE ^M LET #row_count = 0^M ^M ^M (2 Replies)
Discussion started by: lalitpct
2 Replies

11. Shell Programming and Scripting

nslookup hanging

Hey folks. Long time lurker, first time poster. I'm a bit of a newbie at "coding" (obviously, scripting is a teensy bit different than coding) and I've run into a problem that I just can't seem to get around. I'm going through a list of servers to check their name, IP, reverse-NSLOOKUP name and... (2 Replies)
Discussion started by: Bearwhale
2 Replies

12. UNIX for Dummies Questions & Answers

removing newlines without changing RS in BEGIN

Using awk, is there a way to remove newlines in strings that don't contain 1_ at the beginning, but without setting RS="1_" in the BEGIN section and without using a END section as well? input: 1_this is line 1 aaaaaaaa bbbb 1_this is line 2 cccc 1_this is line 3 dddddddddddddd... (7 Replies)
Discussion started by: lucasvs
7 Replies

13. Shell Programming and Scripting

sed Command to skip

Friends, I have 1000 line like below #formate Test.server.e01=http://111.22.33.23/ #test_server_west Test.server.w01=http://112.123.123.22/ Test.server.w02=http://113.143.123.22/ Test.server.w03=http://112.183.123.22/ #test_server_east Test.server.e01=http://115.123.123.22/... (6 Replies)
Discussion started by: jothi basu
6 Replies

14. Shell Programming and Scripting

How to save sorted content of a inside the same file?

Hi All, When i use sort Test, here is the output: $ sort Test a b b c d e f g h i But the contents in the file remain unsorted, how to do that? ]$ cat Test g i (6 Replies)
Discussion started by: chandrakanth
6 Replies

15. Shell Programming and Scripting

Usage of a variable in awk BEGIN

Hi, diffcount=`awk 'BEGIN { while ( getline < "/scripts/matt/text.server1.reference" ) { arr++ } } { if (!( $0 in arr ) ) { print } }' $TMPDIR/$(basename $0 .sh) | wc -l` if ]; then OK="OK - No change in the interfaces status" elif ]; then DIFF=`awk 'BEGIN {... (4 Replies)
Discussion started by: nms
4 Replies