Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^2: Unit testing OS rich code

by Voronich (Hermit)
on Oct 13, 2011 at 13:18 UTC ( #931231=note: print w/replies, xml ) Need Help??

in reply to Re: Unit testing OS rich code
in thread Unit testing OS rich code

I really don't much care about the timestamp. I'm using touch as the quickest easiest way to create an empty file.

Replies are listed 'Best First'.
Re^3: Unit testing OS rich code
by BrowserUk (Pope) on Oct 13, 2011 at 13:34 UTC
    the quickest easiest way to create an empty file.

    Quickest? Definitely not. Easiest? Your call :)

    cmpthese 1, { a=>q[ qx[ touch junka.$_ ] for 1 .. 1000 ], b=>q[ do{ open my $f, ">junkb.$_" } for 1 .. 1000 ], };; s/iter a b a 8.83 -- -95% b 0.421 1997% --

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Certainly quickest for the programmer. This has to create 5 sentinel files every 3 months.

      Love that profiling snippet. Gonna have to pull that for meeting arguments ;)

Re^3: Unit testing OS rich code
by eyepopslikeamosquito (Chancellor) on Oct 17, 2011 at 01:59 UTC

    I'm using touch as the quickest easiest way to create an empty file
    Are you seriously arguing that using:
    `touch $file`
    to create an empty file should be preferred to, for example:
    { open(my $fh, '>', $file) or die "error creating empty '$file': $!"; }
    on the grounds that it is "quicker and easier" to write?

    If you are that stretched for time, how on earth do you expect to find time to write your proposed test mock framework?

      Good grief. I'm in fact not "seriously arguing" anything at all, least of all what someone 'should' be doing.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://931231]
[ambrus]: Today I accidentally cut my hand while carrying a computer. On the display part of the motherboard that sticks out at the back of the chasis and has ports, there's this thin metal sheet with holes cut for the ports, to guide plugs into the sockets.
[ambrus]: This sheet has sharp needle-like parts, 0.004 long and less than 0.001 wide, that can get bent to point outwards, and one of these cut into my palm when I lifted the box.
[ambrus]: So now when I choose what motherboard to buy for my new home computer, I have one more specific property to guide me. Useful, because there's so many different boards to choose from.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2017-01-16 19:36 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (151 votes). Check out past polls.