Sponsored Content
Top Forums Shell Programming and Scripting Prefixing test case methods with letter 'test' Post 302690555 by itkamaraj on Thursday 23rd of August 2012 06:59:05 AM
Old 08-23-2012
Code:
 
$ perl -lane 'if($F[1]!~/test/){$F[1]="test" . "\u$F[1]";}print join " ",@F' input.txt
def testGroupGetVersion(self):
def testSetCurrentGroup(self, listID, listName, path, clientID):

This User Gave Thanks to itkamaraj For This Post:
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

if test case in korn shell

hi, I am new to this forum and this is my first post. I am not too familiar with scripting so I will be spending a lot of time here. I am trying to understand a ksh script. NSCA=/bin/send_nsca if ] What does the -e check for? (3 Replies)
Discussion started by: fluke_perf
3 Replies

2. Programming

Ignore case in a test?

How do I ignore the case in an if condition..? EDIT: I put this in the wrong board...this is a linux script. if then echo "Same name." else echo "Different name." fi (1 Reply)
Discussion started by: Bandit390
1 Replies

3. Shell Programming and Scripting

Test on string containing spacewhile test 1 -eq 1 do read a $a if test $a = quitC then break fi d

This is the code: while test 1 -eq 1 do read a $a if test $a = stop then break fi done I read a command on every loop an execute it. I check if the string equals the word stop to end the loop,but it say that I gave too many arguments to test. For example echo hello. Now the... (1 Reply)
Discussion started by: Max89
1 Replies

4. Shell Programming and Scripting

How to check weather a string is like test* or test* ot *test* in if condition

How to check weather a string is like test* or test* ot *test* in if condition (5 Replies)
Discussion started by: johnjerome
5 Replies

5. Shell Programming and Scripting

PERL - traverse sub directories and get test case results

Hello, I need help in creating a PERL script for parsing test result files to get the results (pass or fail). Each test case execution generates a directory with few files among which we are interested in .result file. Lets say Testing is home directory. If i executed 2 test cases. It will... (4 Replies)
Discussion started by: ravi.videla
4 Replies

6. UNIX for Advanced & Expert Users

Lower case test condition

I want to locate directories that are upper, lower or have both upper and lower cases. What I have is: find /tmp/$var2 -type d' " ); && echo "host case is incorrect" || echo "host case is correct" This actually is part of a larger script and it does work but the problem is that it... (3 Replies)
Discussion started by: newbie2010
3 Replies

7. Shell Programming and Scripting

Trying to test for both upper and lower case directories

I am trying to get a script to print out whether a directory is lowercase uppercase or both. This is what I've got so far: echo -e read "enter name" read server for DIR in $(find /tmp/$server -type d -prune | sed 's/\.\///g');do if expr match "$server" "*$" > /dev/null; then echo "$server -... (7 Replies)
Discussion started by: newbie2010
7 Replies

8. Shell Programming and Scripting

Test command non case specific string comparision

Hi, I want to do caseless string comparision using test command for eg: Ind_f="y" test "$Ind_f" == "y|Y" i tried , ** , nothing worked. any thoughts on how to do case insensitive string comparison using test command without converting to any particular case using typeset or tr? (8 Replies)
Discussion started by: Kulasekar
8 Replies

9. Cybersecurity

DOS resistance Test case help

Hello, I am testing a new software and i need to run also one test case to prove that the device is resistant to DOS attack. I tried using some tools to perform attacks to the machine but i am a little bit confused what i really have to check to prove that the machine have protection against... (0 Replies)
Discussion started by: @dagio
0 Replies
Test::Unit::TestSuite(3pm)				User Contributed Perl Documentation				Test::Unit::TestSuite(3pm)

NAME
Test::Unit::TestSuite - unit testing framework base class SYNOPSIS
package MySuite; use base qw(Test::Unit::TestSuite); sub name { 'My very own test suite' } sub include_tests { qw(MySuite1 MySuite2 MyTestCase1 ...) } This is the easiest way of building suites; there are many more. Read on ... DESCRIPTION
This class provides the functionality for building test suites in several different ways. Any module can be a test suite runnable by the framework if it provides a "suite()" method which returns a "Test::Unit::TestSuite" object, e.g. use Test::Unit::TestSuite; # more code here ... sub suite { my $class = shift; # Create an empty suite. my $suite = Test::Unit::TestSuite->empty_new("A Test Suite"); # Add some tests to it via $suite->add_test() here return $suite; } This is useful if you want your test suite to be contained in the module it tests, for example. Alternatively, you can have "standalone" test suites, which inherit directly from "Test::Unit::TestSuite", e.g.: package MySuite; use base qw(Test::Unit::TestSuite); sub new { my $class = shift; my $self = $class->SUPER::empty_new(); # Build your suite here return $self; } sub name { 'My very own test suite' } or if your "new()" is going to do nothing more interesting than add tests from other suites and testcases via "add_test()", you can use the "include_tests()" method as shorthand: package MySuite; use base qw(Test::Unit::TestSuite); sub name { 'My very own test suite' } sub include_tests { qw(MySuite1 MySuite2 MyTestCase1 ...) } This is the easiest way of building suites. CONSTRUCTORS
empty_new ([NAME]) my $suite = Test::Unit::TestSuite->empty_new('my suite name'); Creates a fresh suite with no tests. new ([ CLASSNAME | TEST ]) If a test suite is provided as the argument, it merely returns that suite. If a test case is provided, it extracts all test case methods from the test case (see "list_tests" in Test::Unit::TestCase) into a new test suite. If the class this method is being run in has an "include_tests" method which returns an array of class names, it will also automatically add the tests from those classes into the newly constructed suite object. METHODS
name() Returns the suite's human-readable name. names() Returns an arrayref of the names of all tests in the suite. list (SHOW_TESTCASES) Produces a human-readable indented lists of the suite and the subsuites it contains. If the first parameter is true, also lists any test- cases contained in the suite and its subsuites. add_test (TEST_CLASSNAME | TEST_OBJECT) You can add a test object to a suite with this method, by passing either its classname, or the object itself as the argument. Of course, there are many ways of getting the object too ... # Get and add an existing suite. $suite->add_test('MySuite1'); # This is exactly equivalent: $suite->add_test(Test::Unit::TestSuite->new('MySuite1')); # So is this, provided MySuite1 inherits from Test::Unit::TestSuite. use MySuite1; $suite->add_test(MySuite1->new()); # Extract yet another suite by way of suite() method and add it to # $suite. use MySuite2; $suite->add_test(MySuite2->suite()); # Extract test case methods from MyModule::TestCase into a # new suite and add it to $suite. $suite->add_test(Test::Unit::TestSuite->new('MyModule::TestCase')); AUTHOR
Copyright (c) 2000-2002, 2005 the PerlUnit Development Team (see Test::Unit or the AUTHORS file included in this distribution). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
o Test::Unit::TestRunner o Test::Unit::TkTestRunner o For further examples, take a look at the framework self test collection (t::tlib::AllTests). perl v5.8.8 2006-09-13 Test::Unit::TestSuite(3pm)
All times are GMT -4. The time now is 02:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy