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

use coverage to guide test written #1150

Merged
merged 1 commit into from
Oct 20, 2024
Merged

use coverage to guide test written #1150

merged 1 commit into from
Oct 20, 2024

Conversation

bobzhang
Copy link
Contributor

No description provided.

Copy link

From the provided git diff output, here are three potential issues or suggestions for improvement in the MoonBit codebase:

  1. Deprecated Functions Duplication:

    • The functions trim_left and trim_right are marked as deprecated and suggest using String::trim_start and String::trim_end respectively. These deprecated functions are present both in string/deprecated.mbt and string/string.mbt. It's redundant to have the same deprecated functions in two different files. Consider consolidating them into one location to avoid confusion and potential inconsistencies.
  2. Test Dependency Management:

    • In string/moon.pkg.json, the test-import section has been updated to include moonbitlang/core/json. Ensure that this new dependency is necessary and properly managed. If json is not directly used in the tests, it might be unnecessary to include it, which could lead to bloated dependencies and potential conflicts.
  3. Unused or Redundant Code:

    • The trim_left and trim_right functions are marked as deprecated and have been moved to string/deprecated.mbt, yet they are still present in string/string.mbt. While this might be intentional for backward compatibility, it's important to ensure that these functions are not being used in active code. If they are indeed no longer needed in string.mbt, removing them could simplify the codebase and reduce potential points of failure.

These observations are based on the changes introduced in the diff and the context provided. Each of these points touches on code organization, dependency management, and code hygiene, which are crucial for maintaining a clean and robust codebase.

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 3651

Details

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 82.744%

Changes Missing Coverage Covered Lines Changed/Added Lines %
string/deprecated.mbt 0 2 0.0%
Totals Coverage Status
Change from base Build 3650: 0.02%
Covered Lines: 4258
Relevant Lines: 5146

💛 - Coveralls

@bobzhang bobzhang merged commit 0013355 into main Oct 20, 2024
12 of 13 checks passed
@bobzhang bobzhang deleted the hongbo/test_coverage branch October 20, 2024 13:58
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