| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Comments:
<0> hey nola <1> merlyn: hey! I might have a perl job.. maybe ... <0> cool <2> argh! competition! <0> I spent yesterday afternoon refactoring a webserver that used POE::Component::Server::HTTP to use POE::Component::Server::SimpleHTTP <1> Botje: you looking? what area? ... I'm in the beautiful city of chicago <0> I then used my unit tests, and uncovered a bug in another part of my code. :) <3> merlyn: what would you say is the best unit testing for a n00b to start out testing with? <2> Nola: i'm in the beautiful (well, it's raining now) country of belgium :P <1> merlyn: horray! ... I told this new gig about Test :: More and TAP ... they don't test now <2> f00li5h: Test::Simple <3> Botje: hrm, so that one should be the best one to play with, <2> f00li5h: but read Test::Tutorial. <3> Botje: did, it didn't make much sence to me.
<3> it may be the paridigm shift though <0> I refactored so I could use SSL (which SimpleHTTP supports), and also so I could subcl***, because SimpleHTTP uses real states, not odd callbacks, to handle the URLs <1> f00li5h: did you follow along and make some examples as you went? <0> which means I can declare a derived cl*** from the object I just created, and get all the URLs handled *and* more <3> Nola: well, a little, but i don't know where to put the tests, you see? <4> Hi merlyn <0> f00li5h - they generally go in t/*.t <4> Ho f00li5h <3> merlyn: do go on <0> so you have bin/* your scripts, and lib/* your modules <1> f00li5h: you just pu them in their own file .. where merlyn says :) <3> rindolf: ho there! <0> and t/*.t tests the stuff in lib/*, and to a lesser extent, the stuff in bin/* <3> Nola: so grouped by? <1> look at an existing module <0> the trick is making yoru lib/* so that it *can* be tested. <1> look in the t directory <3> Nola: i don't have one <_< <3> merlyn: yes! <0> but that also means you're thinking about how isolated a "unit" can be, which is actually a *good* thing <3> tell me more of this `can be tested' <4> f00li5h, did you start with module-starter or whatever? <3> rindolf: no, i started with mkdir <4> f00li5h, heh. <0> for example, I have a cl*** that used another cl***. to test the first cl***, I really didn't want it using the second cl***, so I added a hook so that I could "p*** in" the "second cl***" to use. <4> f00li5h, are you trying to write a CPAN module? <0> now in testing, I p*** in a dummy second cl***. <4> f00li5h, or just a regular Perl module distribution? <3> rindolf: heck no. nobody wants this crap <0> which is really a little test dummy that reports what methods the first cl*** is calling. <3> i just want to be able to look at green lights and go `^_^ its working' <0> so that's an example of "designing to be tested" <4> Nola, are you new here? <0> the advantage is that my first cl*** is now reusable in a different system that might need a different "other cl***" to be useful. <0> hardwired "other" cl***es are generally trouble. <3> merlyn: like reading a config file, so i know what to expect a configurable cl*** will do? <0> generally, it's in the parameters you p*** to ->new <0> I have a "manager" cl*** that creates "worker" object <0> so I p*** in my TestWorker cl*** name instead <3> merlyn: and then sits there taking the credit? <0> but by default, it would use the standard Worker cl*** <5> good morning. <4> Hi Teratogen <3> good day Teratogen <0> I define TestWorker directly in the .t file, and it shares closure variables with things my test code can see <0> so my .t code calls Manager which creates TestWorker which triggers vars which the .t code can monitor <0> then I can make sure that Manager would do the right things to Worker <3> merlyn: that's pretty ***y <0> It's actually pretty standard... I can't take credit for it <0> in fact, there's Test::MockObject to do this generically <3> merlyn: well, i guess i'll just say that you're a lot better at this than i am ... <0> Well - this is why $client went from simply bringing me in for a few weeks, to extending the contract to five months by reporting to upper management that I was "critical to the completion of the project" <3> merlyn: ie you were the only one there that actually knew perl... the others were just mashing the keys, and faking it? <0> No - everyone knows Perl more or less. <0> but nobody knows it like me. <6> Not even Larry! <6> or Damian! <0> <melbrooks>It's Good To Be The King</melbrooks> <0> well, Larry and Damian know it "differently" :) <6> heh <0> Larry and I have similar programming histories, and I've *used* Perl actually a lot more than he has. :)
<0> I haven't been burdened by constantly looking at the insides. :) <0> "are you gonna drive, or just spend all your time under the hood?" <3> aah, i see <7> I wish the code controlling the replacement part of s/// wasn't so confusing to me. <7> I'm slipping in my C-fu. <0> Ilya-code. :) <0> obfu-russian <7> merlyn: all I wanted to do was patch s/// to accept /r as a modifier, whereby the modified string is returned, and the original variable remains untouched <0> Eeek. <7> but that is proving way harder than I thought <8> oh, I tried that once <0> sounds great, but I bet it's a nightmare <8> it seemed to build <7> mauke: you retained your sanity! <0> you can't lose what you don't have in the first place. <0> the fact that he *tried* already demonstrates that. <8> no brain, no pain <3> merlyn: credit card. <7> actually, I've been looking at it the wrong way. <7> I should copy the scalar first, replace TARG with that copy, and then return TARG. <7> I'll try it again this afternoon... <0> oddly, I thought /r would be ***eger. :) <7> merlyn: no, that's a whole nother can of worms. <7> I've since changed my mind: you want a reversed regex, you pay me ;) <7> or DIY <8> add it to tr/// too, while you're at it <0> and chomp()! <8> chomp/$foo/r <0> people often do $a = chomp($a) <0> oops. :) <8> $foo =~ chomp//r <6> I wish chomp worked like that :| <3> merlyn: i find that i don't do that, out of habbit. php's chop doesn't work in place. and it takes ages to hunt down <0> just avoid php :) <0> Pretty Home Page. :) <6> s/\'s chop//; s/ in place//; <3> merlyn: they've put my job up for `internal advertising, followed by public [me] advertising' and perhaps i'll find a perl job before i re-apply. <9> so they are trying to get rid of you? <3> they say no, but they're replacing contractors with permi's <3> so more or less... i looks that wya <4> merlyn: I'm writing PHP now. <3> rindolf: i feel for you. <7> you see, that's why I like about ruby... <7> y = chomp(x); <7> chomp!(x); <3> japhy: that it's not php? <0> You're probably not writing PHP like Rasmus writes PHP. :) <4> f00li5h: no, that you can add ! to do stuff in place. <7> err, methods, though <7> y = x.chomp; <7> x.chomp!; <3> rindolf: how does that work? <4> f00li5h: in Ruby? <3> rindolf: f(x,y):z <7> f00li5h: you have to IMPLEMENT the in-place thing. <3> japhy: and say which arg it inplaces? <7> 'chomp' and 'chomp!' are two different methods, I would expect. chomp! merely says x = x.chomp <7> but I could be totally wrong, too <0> we could *all* be totally wrong! <8> use subs 'chomp'; sub chomp { unless (defined wantarray) { CORE::chomp(@_); return } CORE::chomp(my @x = @_); wantarray ? @_ : $_[0] } <5> *chomp* <7> it might be that THING.xyz! defaults to being: THING = THING.xyz <10> you guys have the knowledge <7> unless .xyz! is defined otherwise <0> maybe *python* actually makes sense, if you've used it long enough <4> /~ If you've got the knowledge honey, I've got the ties... ~/ <10> i hope someday i can progress to have the knowledge also <7> nah, I don't think python makes enough sense. <7> python can't make sense without importing it first ;) <0> or TCL, which I call, Bracket Hell <0> all the syntax of Lisp with very little of the power. <7> someone can feel free to quote me on that, by the way. <0> apparently - people quote me whether I give permission or not. :) <0> damn pedestals. :)
Return to
#perl or Go to some related
logs:
reinit raid mdadm #python xgl conkey
Eulex log what do numbers mean linux syslog trouble wlanassistant fglrx dapper 9200 printfps ubuntu how does gdm authenticate? ethereal sudoer riotgeek
|
|