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

Fix Read{,List}[] with TokenWord and improve ... #1104

Merged
merged 1 commit into from
Oct 3, 2024
Merged

Conversation

rocky
Copy link
Member

@rocky rocky commented Sep 29, 2024

  • Read{,List}[] with TokenWord needs to return two tokens sometimes
  • Adjust error message the right value of Read or ReadList is used.
  • simplify logic in eval/files_io/read.py
  • Add data_dir variable that can be used in testing.

* Read{,List}[] with TokenWord needs to return two tokens sometimes
* Adjust error message the right value of Read or ReadList is used.
* simplify logic in eval/files_io/read.py
* Add data_dir variable that can be used in testing.
@rocky
Copy link
Member Author

rocky commented Sep 29, 2024

There will be at least two more rounds of PRs, but this is already getting large.

One round involves splitting out Reading & Writing Files from mathics.builtins.file_io.files . And with this, the corresponding tests in test_files.py will be moved. And test_read will be renamed probably to readwrite with mathics.builtins.file_io.readwrite getting created. So mathics.eval.files_io.read will also get renamed.

In this test for this PR, I suggest a better way of accessing test data than using StringToStream, and this probably could simplify other existing tests as well.

There will be another round to increase test coverage. But do it in a way that is not as messy as the pytest and doctest code we have right now.

I am always amazed at the pile of mess we still are digging out of.

A second round will be

The I/O routines are just such a big mess

Copy link
Contributor

@mmatera mmatera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rocky rocky merged commit 6860e5c into master Oct 3, 2024
11 checks passed
@rocky rocky deleted the Read-fixes-part2 branch October 3, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants