Test.More isaOK works differently that Test::Simple isa_ok

5 views
Skip to first unread message

Mark Stosberg

unread,
Dec 1, 2005, 10:33:51 AM12/1/05
to JSAN Authors
Hello,

I'm diving into JSAN today. If all goes well, I'll have a new test for
HTML.FormValidator to share soon.

In the process, I noticed something that felt like a bug in Test.More
isaOK.

It failed the test when the class name I gave it was a parent of the
class the thing actually was.

In Perl's Test::More, isa_ok() reports success on any class that is
part of the inheritence tree. JavaScript's stricter definition tripped
me up.

Bug, or intentional difference?

Mark

David Wheeler

unread,
Dec 1, 2005, 8:02:38 PM12/1/05
to jsan-a...@googlegroups.com
On Dec 1, 2005, at 7:33 AM, Mark Stosberg wrote:

> It failed the test when the class name I gave it was a parent of the
> class the thing actually was.
>
> In Perl's Test::More, isa_ok() reports success on any class that is
> part of the inheritence tree. JavaScript's stricter definition tripped
> me up.
>
> Bug, or intentional difference?

Note this paragraph from the docs for isaOK():

> Note that inheritance is detected only for versions of JavaScript
> that support
> the isPrototypeOf() method. Earlier versions of JavaScript will
> only detect an
> exact match for class membership.

Your best bet in such circumstances is to SKIP the test on those
platforms.

Best,

David
Reply all
Reply to author
Forward
0 new messages