Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: startColumn makes CSV parser return empty array. #7272

Closed
TorsteinHonsi opened this issue Oct 13, 2017 · 4 comments
Closed

Regression: startColumn makes CSV parser return empty array. #7272

TorsteinHonsi opened this issue Oct 13, 2017 · 4 comments
Assignees

Comments

@TorsteinHonsi
Copy link
Collaborator

Live demo with steps to reproduce

http://jsfiddle.net/hr6j17eq/2/

@TorsteinHonsi
Copy link
Collaborator Author

Related: #7265

@TorsteinHonsi
Copy link
Collaborator Author

There's still something fishy - check out this test. It concatenates column 0 with column 1. This test can replace the last test in data/csv/demo.js when fixed.

QUnit.test('startRow, endRow, startColumn, endColumn', function (assert) {
    var data =
        'Pad,Pad,Pad,Pad\n' +
        'Pad,Apples,Pears,Pad\n' +
        'Pad,1,2,Pad\n' +
        'Pad,5,6,Pad\n' +
        'Pad,Pad,Pad,Pad';

    Highcharts.data({
        csv: data,
        startRow: 1,
        endRow: 3,
        startColumn: 1,
        endColumn: 2,
        parsed: function () {

            assert.strictEqual(
                this.columns.length,
                2,
                'Two columns included'
            );
            assert.strictEqual(
                this.columns[0].join(','),
                'Apples,1,5',
                'First column ok'
            );
            assert.strictEqual(
                this.columns[0].length,
                3,
                'Three rows included'
            );
        }
    });

});

@cvasseng
Copy link
Contributor

This may be related to the fix I did for the delimiter guessing, if so I have a hunch on how to fix it. WIll try to take a look today.

@cvasseng
Copy link
Contributor

Shouldn't we keep the last test in data/csv/demo.js? The current last one tests string quoting (e.g. "A string with ""quotes"" in it", while the above one tests start/end row/column.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants