use-case for isnt()

2009-02-12 Thread Gabor Szabo
Hi, With the obvious risk of being laughed at, I'd like to ask you guys for a good use-case of isnt() in Test::More. the one in the docs looks like this: # $foo isn't empty isnt( $foo, '', "Got some foo" ); which feels such a weak test I don't think I'd write it. You? Gabor

Re: use-case for isnt()

2009-02-12 Thread Renee Bäcker
Gabor Szabo schrieb: > Hi, > > With the obvious risk of being laughed at, I'd like to ask > you guys for a good use-case of isnt() in Test::More. You can search some code for uses of "isnt()": http://www.google.com/codesearch?q=isnt\(+lang%3Aperl&hl=de&btnG=Code+suchen - Renee

Re: use-case for isnt()

2009-02-12 Thread Eirik Berg Hanssen
Gabor Szabo writes: > With the obvious risk of being laughed at, I'd like to ask > you guys for a good use-case of isnt() in Test::More. What's "good"? Anyway ... I've used it testing that objects are clones and not copies: # quick and dirty: isnt( $clone, $original, 'Not a copy' ); # mo

Re: use-case for isnt()

2009-02-12 Thread Nicholas Clark
On Thu, Feb 12, 2009 at 02:20:13PM +0200, Gabor Szabo wrote: > Hi, > > With the obvious risk of being laughed at, I'd like to ask > you guys for a good use-case of isnt() in Test::More. > > the one in the docs looks like this: > > # $foo isn't empty > isnt( $foo, '', "Got some foo" ); > >

Re: use-case for isnt()

2009-02-12 Thread Yitzchak Scott-Thoennes
On Thu, February 12, 2009 4:20 am, Gabor Szabo wrote: > the one in the docs looks like this: > > # $foo isn't empty > isnt( $foo, '', "Got some foo" ); > > which feels such a weak test I don't think I'd write it. Somewhat longer version of the same thing: my $warn = ''; %SIG{__WARN__} = sub {

Re: use-case for isnt()

2009-02-12 Thread Michael G Schwern
Yitzchak Scott-Thoennes wrote: > On Thu, February 12, 2009 4:20 am, Gabor Szabo wrote: >> the one in the docs looks like this: >> >> # $foo isn't empty >> isnt( $foo, '', "Got some foo" ); >> >> which feels such a weak test I don't think I'd write it. > > Somewhat longer version of the same th

Re: use-case for isnt()

2009-02-13 Thread Gabor Szabo
On Thu, Feb 12, 2009 at 11:36 PM, Michael G Schwern wrote: > Yitzchak Scott-Thoennes wrote: >> On Thu, February 12, 2009 4:20 am, Gabor Szabo wrote: >>> the one in the docs looks like this: >>> >>> # $foo isn't empty >>> isnt( $foo, '', "Got some foo" ); >>> >>> which feels such a weak test I

Re: use-case for isnt()

2009-02-13 Thread Michael G Schwern
Gabor Szabo wrote: > Thanks for all the examples and links! > I tried to do it but this is the first time I am forking something on > github and > I am very new to git so pls let me know if you can use it. Yep, that all worked fine. Thanks. See how wonderful that is? github provides me with a "

Re: use-case for isnt()

2009-02-14 Thread Gabor Szabo
On Thu, Feb 12, 2009 at 3:18 PM, Nicholas Clark wrote: > I find > >isnt($foo, undef); > > useful as it gives better failure diagnostics than > >ok(defined $foo); > Wouldn't it be better to write this is_defined($foo); Which, on failure would print # got: undef # expect

Re: use-case for isnt()

2009-02-14 Thread Nicholas Clark
On Sat, Feb 14, 2009 at 12:57:45PM +0200, Gabor Szabo wrote: > On Thu, Feb 12, 2009 at 3:18 PM, Nicholas Clark wrote: > > I find > > > >isnt($foo, undef); > > > > useful as it gives better failure diagnostics than > > > >ok(defined $foo); > > > > Wouldn't it be better to write this > >

Re: use-case for isnt()

2009-02-14 Thread Michael G Schwern
Nicholas Clark wrote: > On Sat, Feb 14, 2009 at 12:57:45PM +0200, Gabor Szabo wrote: >> On Thu, Feb 12, 2009 at 3:18 PM, Nicholas Clark wrote: >>> I find >>> >>>isnt($foo, undef); >>> >>> useful as it gives better failure diagnostics than >>> >>>ok(defined $foo); >>> >> Wouldn't it be bett