Skip to content

[p5.js 2.0 Bug Report]: IO loadTable test failed #7854

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

Open
1 of 17 tasks
madhav2348 opened this issue May 31, 2025 · 6 comments
Open
1 of 17 tasks

[p5.js 2.0 Bug Report]: IO loadTable test failed #7854

madhav2348 opened this issue May 31, 2025 · 6 comments

Comments

@madhav2348
Copy link

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

No response

Web browser and version

No response

Operating system

Windows

Steps to reproduce this

Steps:

  1. run command npm test

Snippet:

CSV files should handle escaped quotes and returns within quoted fields
AssertionError: expected 'David,\r\nSr. "the boss"' to equal 'David,\nSr. "the boss"'
 - /test/unit/io/loadTable.js:87:12
- Expected
+ Received

- David,
+ David,

  Sr. "the boss"
@perminder-17
Copy link
Collaborator

Hi @madhav2348 , Thanks so much for reporting this. Btw, I am unable to reproduce this issue in the dev-2.0 branch. Can you just confirm if it fails with the latest build of p5.js in dev-2.0 branch?

@VANSH3104
Copy link
Contributor

Hi @perminder-17,I’ve also tried running the tests on the latest dev-2.0 branch and I am not able to reproduce this issue either.
@madhav2348 can you provide a more detailed explanation and steps to reproduce the problem.

@madhav2348
Copy link
Author

madhav2348 commented Jun 4, 2025

I'm sure it's dev-2.0 branch. I install npm packages using npm ci and before starting any changes, I run npm test, where I sometimes test timeout happen in in WebGL which is mention it #7869 and another test failed in visual test #7823 . With the following test fail

 FAIL |unit|  test/unit/io/loadTable.js > loadTable > CSV files should handle escaped quotes and returns within quoted fields
AssertionError: expected 'David,\r\nSr. "the boss"' to equal 'David,\nSr. "the boss"'

- Expected
+ Received

- David,
+ David,
  Sr. "the boss"

 ❯ test/unit/io/loadTable.js:87:12
     85|     const table = await mockP5Prototype.loadTable(validFile);
     86|     assert.equal(table.getRowCount(), 4);
     87|     assert.equal(table.getRow(3).get(0), 'David,\nSr. "the boss"');
       |            ^
     88|   });
     89| });

Image

@perminder-17
Copy link
Collaborator

Thanks for the update @madhav2348 and also thanks for raising this one.

CC: @davepagurek , Is this test a flaky test? Since when I ran on my syste (ubuntu-latest) the test for loadTable didn't failed.

Image

Do you have any ideas?

@madhav2348
Copy link
Author

madhav2348 commented Jun 4, 2025

Since my system is Windows, it may vary on OS. If not able to reproduce the error, then let me know to close it, or you could, because only my system is generating it
Thankyou

@limzykenneth
Copy link
Member

It seems the difference is around line ending where windows parse new line as \r\n while unix parse as \n. @perminder-17 Not sure if you are testing on Windows? If it is indeed line ending error, it can possibly be fixed either in the test with regex testing for both line endings, or force line endings in loadTable()'s implementation to always parse as \n.

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

4 participants