2012-01-03 03:52:05 +04:00
|
|
|
var PO = require('../lib/po.js')
|
2011-12-23 04:12:01 +04:00
|
|
|
, fs = require('fs')
|
|
|
|
, assert = require('assert')
|
2012-01-03 03:52:05 +04:00
|
|
|
|
|
|
|
PO.load('text.po', function(po) {
|
|
|
|
assert.equal(po.headers['Plural-Forms'], 'nplurals=2; plural=(n!=1);', 'Parsed "Plural-Forms" header.');
|
|
|
|
assert.equal(po.items.length, 67, 'Successfully parsed 67 items.');
|
|
|
|
var item = po.items.pop();
|
|
|
|
assert.equal(item.comments.length, 1, 'Parsed item comment.');
|
2012-01-03 04:06:32 +04:00
|
|
|
po.save('copy.po');
|
2011-12-23 04:12:01 +04:00
|
|
|
});
|
2012-01-03 03:52:05 +04:00
|
|
|
|