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
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
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
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" );
>
>
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 {
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
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
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 "
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
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
>
>
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
11 matches
Mail list logo