On Fri, Apr 08, 2005 at 12:36:16PM -0400, Geoffrey Young wrote: > as someone familiar with T::M and not javascript, were I to try to use this > it's an additional barrier to call it "Test::More in JavaScript" but not > provide _the exact same functions_ as Test::More. now before everyone > starts slamming this let me explain...
Nahh, I'll start slamming now. :) The eq_* salad was a mistake and I've been planning on deprecating them for a while now. No sense in parroting mistakes forward. In fact, I should probably get around to doing that before more implementations spring up. > as we shaped the php T::M port we started hitting a few things that were > perlish but not phpish. isa_ok() is a good example - isa() is a perl method > but php calls it something else. so, what we plan on doing (or did, > depending on the function) is implementing isa_ok() for the perl folks and > aliasing it to foo_ok() (I forget what) for the php folks. I think we > carried over use_ok() even though php doesn't distinguish between use and > require in the perl sense, for example. > > I guess what I'm trying to say is that, really, the target audience for > these ports is primarily people who are already Test::More savvy. so, > taking away eq_array() or calling something isDeeply() just makes my life as > a perl-first developer more difficult. ok, marginally so, but still... This is sort of true and sort of not. The original authors of the tests might be those which are Test::More savvy but the users of the code, and thus contributors, are likely not. The short-term idea is to make Perl programmers more comfortable testing in other languages. The long-term idea is to propogate a testing system into another community. Both the TAP protocol for test interoperability and the Test::More test writing style so there's something out there which is not XUnit. This means it should make sense to non-Perl programmers, and that its more important in the long run that it does. So the nativized aliases are a good idea. In fact, I'd go so far as to discourage the use of the Perlish idioms. Just mention in the docs "wibble_ok() is like isa_ok()..." If you know PHP (or whatever) and understand how inheritence works in PHP it should not confuse you to find isa_ok() is called wibble_ok() (umm... assuming PHPers refer to inheritence as "wibble"). In the same way that David translated from whatever_this_style_is_called() to studlyCaps() because the latter is (I'm assuming) considered good Javascript style. Javascript programmers will be comfortable with it and any native Perl programmer looking at it would know enough Javascript to expect it.