Skip to content

Implement Assertions for TaskManager File Handling#1

Merged
zyng233 merged 1 commit intomasterfrom
branch-A-Assertions
Sep 8, 2024
Merged

Implement Assertions for TaskManager File Handling#1
zyng233 merged 1 commit intomasterfrom
branch-A-Assertions

Conversation

@zyng233
Copy link
Copy Markdown
Owner

@zyng233 zyng233 commented Sep 8, 2024

This PR introduces assertions into the TaskManager class to enhance the reliability of file handling operations.

  • Added assertions to check the successful creation of directories and files.
  • Verified that lines read from files are non-null and non-empty.
  • Ensured tasks are not null before saving to files.

The previous implementation lacked robust error checking, which could lead to runtime issues if files or directories were not created properly. Adding these assertions helps catch issues early and ensures that file operations are handled correctly.

This refactor improves the robustness of file handling in the TaskManager class and helps in identifying and debugging issues related to file operations.

Ensure that all file-related operations are tested to verify that the assertions are correctly triggered in case of failures.

Refactor file handling in TaskManager to improve reliability.

The TaskManager class handles file operations for loading and saving
tasks. Previously, the file creation and directory handling lacked
robust error checking.

This refactor includes:
* Adding assertions for directory and file creation
* Verifying lines read from the file are non-null and non-empty
* Ensuring tasks are not null before saving

This enhances reliability and helps catch issues early in development.
@zyng233 zyng233 merged commit e3db3e6 into master Sep 8, 2024
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.

1 participant