-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmp_document branch #49
base: master
Are you sure you want to change the base?
Conversation
I agree with the intent of this, but it doesn't seem to make things It does seem to make a few of the examples harder to run the test in the I'm more ambivalent on losing the t::lib namespace, but it was an
|
Losing t::lib was based on other feedback. I'm not wedded to it myself. I can see your point about the debugger. That's a blind spot for me. In the cases where only one thing is being checked, tests with cmp_element will look similar, yes. My feeling is that with cmp_*:
[
{ class => 'PPI::Token::Quote::Double', content => '"y"' },
{ class => 'PPI::Token::Operator', content => 'x' },
{ class => 'PPI::Token::Number', content => '3' },
] ], Being able to ignore whitespace elements while doing the above is nice, too. Testing
|
Regarding t::lib, that was my idea. While it can be nice, i didn't see any advantages by being clever in that way, when PPI::Test does the same thing and is quite explicit about what happens. On the other hand, i'm not wedded to the idea of removing that and don't mind if reverting that makes you happier, @adamkennedy. :) Now, as for the main part of the commit: I do think @moregan is on the right trail, but hasn't gone far enough yet. I also agree with the debuggerability complaint, as i've run into that before. I added two commits on his branch as a proof of concept to demonstrate how it could be made both more concise, easier to read, write, and still highly breakpointable: https://github.com/adamkennedy/PPI/commits/cmp_document In short, the main idea is: Hashes are cool, but if you end up typing the same hash again and again and again, it's better to have an array that gets converted to a hash. |
I've been trying to remember why the hell I created t::lib in the forest Adam
|
dcc718c
to
04bd318
Compare
f5a547d
to
c0b5b97
Compare
c0b5b97
to
d6e3c2d
Compare
07cd2bb
to
46e810f
Compare
Reorganize t/lib modules so that names to not conflict with lib/* modules under use lib 't/lib'.
Add t/lib/PPI/Test/pragmas.pm to centralize test file boilerplate.
Add cmp_document family of test functions.
As a sample, converted ppi_token_quote_double.t to use new test functions.