@@ -111,36 +111,37 @@ describe('Node-Libxml', function () {
111111 expect ( currentDtd ) . to . have . property ( 'systemId' , 'mydoctype.dtd' ) ;
112112 libxml . freeXml ( ) ;
113113 } ) ;
114- // it('Shoud return correct xpath values', function () {
115- // let libxml = new Libxml(),
116- // xmlfile = libxml.loadXml('test/data/test-default.xml'),
117- // info = libxml.xpathSelect('string(//infos)'),
118- // infodust = libxml.xpathSelect('number(//infosdust)'),
119- // attrib = libxml.xpathSelect('string(//infos/@attrib)'),
120- // infoExist = libxml.xpathSelect('boolean(//infos)'),
121- // info23NotExist = libxml.xpathSelect('boolean(//infos23)'),
122- // xpathToMyExist = libxml.xpathSelect('boolean(/xpath/to/my)'),
123- // nbElementsInMy = libxml.xpathSelect('count(//my//*)'),
124- // nbElementsInXpath = libxml.xpathSelect('count(/xpath//*)');
114+ it ( 'Should return correct xpath values' , function ( ) {
115+ let libxml = new Libxml ( ) ;
116+ let xmlfile = libxml . loadXml ( 'test/data/test-default.xml' ) ;
117+ expect ( xmlfile ) . to . be . true ;
118+ let info = libxml . xpathSelect ( 'string(//infos)' ) ,
119+ infodust = libxml . xpathSelect ( 'number(//infosdust)' ) ,
120+ attrib = libxml . xpathSelect ( 'string(//infos/@attrib)' ) ,
121+ infoExist = libxml . xpathSelect ( 'boolean(//infos)' ) ,
122+ info23NotExist = libxml . xpathSelect ( 'boolean(//infos23)' ) ,
123+ xpathToMyExist = libxml . xpathSelect ( 'boolean(/xpath/to/my)' ) ,
124+ nbElementsInMy = libxml . xpathSelect ( 'count(//my//*)' ) ,
125+ nbElementsInXpath = libxml . xpathSelect ( 'count(/xpath//*)' ) ;
125126
126- // expect(info).to.be.a.string;
127- // expect(info).to.have.string('trezaq');
128- // expect(infodust).to.be.a('number');
129- // expect(infodust).to.equal(23);
130- // expect(attrib).to.be.a.string;
131- // expect(attrib).to.have.string('example');
132- // expect(infoExist).to.be.a('boolean');
133- // expect(infoExist).to.be.true;
134- // expect(info23NotExist).to.be.a('boolean');
135- // expect(info23NotExist).to.be.false;
136- // expect(xpathToMyExist).to.be.a('boolean');
137- // expect(xpathToMyExist).to.be.true;
138- // expect(nbElementsInMy).to.be.a('number');
139- // expect(nbElementsInMy).to.equal(2);
140- // expect(nbElementsInXpath).to.be.a('number');
141- // expect(nbElementsInXpath).to.equal(4);
142- // libxml.freeXml();
143- // });
127+ expect ( info ) . to . be . a . string ;
128+ expect ( info ) . to . have . string ( 'trezaq' ) ;
129+ expect ( infodust ) . to . be . a ( 'number' ) ;
130+ expect ( infodust ) . to . equal ( 23 ) ;
131+ expect ( attrib ) . to . be . a . string ;
132+ expect ( attrib ) . to . have . string ( 'example' ) ;
133+ expect ( infoExist ) . to . be . a ( 'boolean' ) ;
134+ expect ( infoExist ) . to . be . true ;
135+ expect ( info23NotExist ) . to . be . a ( 'boolean' ) ;
136+ expect ( info23NotExist ) . to . be . false ;
137+ expect ( xpathToMyExist ) . to . be . a ( 'boolean' ) ;
138+ expect ( xpathToMyExist ) . to . be . true ;
139+ expect ( nbElementsInMy ) . to . be . a ( 'number' ) ;
140+ expect ( nbElementsInMy ) . to . equal ( 2 ) ;
141+ expect ( nbElementsInXpath ) . to . be . a ( 'number' ) ;
142+ expect ( nbElementsInXpath ) . to . equal ( 4 ) ;
143+ libxml . freeXml ( ) ;
144+ } ) ;
144145 // // // ABOVE IS ALL THE SAME WITH MEMORY MANUAL MANADGEMENT
145146 it ( 'should free XML memory & infos when asked in manual mod On not wellformed xml' , function ( ) {
146147 let libxml = new Libxml ( true ) ;
0 commit comments