Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^4: Comparison of XML files ignoring ordering of child elementsby kcott (Archbishop) |
on Jan 17, 2019 at 11:30 UTC ( [id://1228689]=note: print w/replies, xml ) | Need Help?? |
G'day adikan123, Welcome to the Monastery. I appreciate that you're new to both Perl and PerlMonks: the following is not intended as a rebuke. Asking for help without indicating what you're having difficulty with is problematic; it's difficult to know exactly what sort of aid you're looking for. Please look at "How do I post a question effectively?" and "Short, Self-Contained, Correct Example" for information about how you can help us to help you. I'll attempt to provide some assistance here. You may have follow-up questions: if so, please follow the linked guidelines when replying. The first place to look for information on a module's usage is the SYNOPSIS. Other sections of the documentation usually provide additional usage information: those with headings like Description and Methods are obvious candidates, but don't overlook Caveats, Limitations, and similar. There's often a plethora of useful information in the distribution files which should all be listed in a MANIFEST. Test scripts written by the module's author (in the t/ directory) can often be very helpful; also look for directories with names like examples/ and demos/. Probably as a last resort, you can also look at the module's source code. I've never used Test::XML::Ordered. It installed without any problems for me. If you had any problems at this stage, you'll need to provide details.
The first line of the SYNOPSIS is:
If the Test::* modules, in general, are new to you, you should familiarise yourself with the documentation for Test::More. That's a core module which you should already have installed. I had problems with the next line:
Although the documentation says that is_xml_ordered is exported, apparently it's not:
Perhaps that's where you had problems. I fixed it with:
The remainder of the SYNOPSIS code seemed to work without any further issues. Here's an example test script I put together.
The output was as expected: $got_good succeeded; $got_bad failed.
I've used prove. This is a core utility which you should have installed: you can run my test script the same way. Of course, you may want to use "make test" or something else; again, without details of your intended usage, I can't really advise further. — Ken
In Section
Seekers of Perl Wisdom
|
|