2 * @fileoverview Tests the way that dygraphs parses data.
4 * @author danvk@google.com (Dan Vanderkam)
6 var parserTestCase
= TestCase("parser");
8 parserTestCase
.prototype.setUp
= function() {
9 document
.body
.innerHTML
= "<div id='graph'></div>";
12 parserTestCase
.prototype.tearDown
= function() {
15 parserTestCase
.prototype.testDetectLineDelimiter
= function() {
22 assertEquals("\r", Dygraph
.detectLineDelimiter(data
));
30 assertEquals("\n", Dygraph
.detectLineDelimiter(data
));
38 assertEquals("\n\r", Dygraph
.detectLineDelimiter(data
));
41 parserTestCase
.prototype.testParseDosNewlines
= function() {
53 var graph
= document
.getElementById("graph");
54 var g
= new Dygraph(graph
, data
, opts
);
56 assertEquals(0, g
.getValue(0, 0));
57 assertEquals(-1, g
.getValue(0, 1));
58 assertEquals(1, g
.getValue(1, 0));
59 assertEquals(0, g
.getValue(1, 1));
60 assertEquals(['X', 'Y'], g
.getLabels());