adding serializeCSV function and test

This commit is contained in:
Mike Morris
2012-07-14 20:30:50 -04:00
parent b48b0eeb85
commit 11e1a17d6a
2 changed files with 98 additions and 0 deletions

View File

@@ -64,5 +64,19 @@ test("parseCSVdelimiter", function() {
});
test("serializeCSV", function() {
var csv = [
['Jones, Jay', 10],
['Xyz "ABC" O\'Brien', '11:35' ],
['Other, AN', '12:35' ]
];
var array = recline.Backend.CSV.serializeCSV(csv);
var exp = '"Jones, Jay",10\n' +
'"Xyz ""ABC"" O\'Brien",11:35\n' +
'"Other, AN",12:35\n';
deepEqual(array, exp);
});
})(this.jQuery);