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

Enhance test coverage #164

Merged
merged 12 commits into from
Feb 11, 2024
Merged

Enhance test coverage #164

merged 12 commits into from
Feb 11, 2024

Conversation

SmetDenis
Copy link
Owner

No description provided.

Denis Smet added 4 commits February 11, 2024 20:06
The changes of this commit are made to the lint sequence inside bb.edn file. The 'splint' style check was removed from the sequencing. Now, the lint sequence now includes only 'cljfmt', 'cljstyle', 'eastwood', and 'kondo'. This simplifies the sequence and prioritizes the rest of the style checks.
The code was restructured to reorder, rename, and modify complex number functions in Clojure for two models ("Ben's way" and "Alyssa's way"). Float typecasting was added to some functions to ensure accurate calculations. Corresponding tests were also implemented in a new test file to validate and ensure the correctness of these revised functions. These changes enhance code clarity and testing comprehensiveness in handling complex numbers.
The :require block in the testing file book_2_4_test.clj has been reformatted to improve readability. No functionality was changed in this commit, just the way the code is organized for aesthetically pleasing and more manageable structure.
@coveralls
Copy link

coveralls commented Feb 11, 2024

Pull Request Test Coverage Report for Build 7864862393

  • 54 of 57 (94.74%) changed or added relevant lines in 6 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+5.7%) to 93.491%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/sicp/chapter_2/part_4/book_2_4.clj 38 39 97.44%
src/sicp/chapter_2/part_4/ex_2_73.clj 7 9 77.78%
Files with Coverage Reduction New Missed Lines %
src/sicp/chapter_2/part_4/ex_2_73.clj 1 57.63%
Totals Coverage Status
Change from base Build 7856798253: 5.7%
Covered Lines: 2298
Relevant Lines: 2458

💛 - Coveralls

Denis Smet added 8 commits February 11, 2024 23:47
Refactored exception handling in tests across multiple modules, replacing previous implementations with the centralized and enhanced `is-exception?` macro. This macro captures the exception type and message and eliminates repeated code, enhancing code cleanliness and maintainability.
Refactored the way exceptions are checked in tests across various modules. This was done by changing from direct exception checks to using the `is-exception?` macro. This improves code readability and makes the test scripts more maintainable.
Fixed a typo and improved the naming pattern for the "test coverage" workflow in the main GitHub actions YAML file. This change contributes to better workflow organization and execution clarity.
Created new test files for exercises 2-73 and 2-75. The test cases for these exercises are now fully covered. Also, made some improvements in the derivation functions in exercise 2-73 by replacing `put` with `put-op`
and `get` with `get-op` methods to manage operations in a more optimized way.
Updated the clj-kondo command in the lint task to run in parallel, improving performance. Also simplified the clojure.test import statement in the ex_2_75_test file to only include 'deftest' and 'is', making the dependencies clearer and more specific.
The clj-kondo command in the lint task has been updated to run in parallel, setting the fail level as a warning. This amendment should improve performance by running in a non-blocking mode. The clojure.test import usage in the book_2_
Simplified exception handling by removing explicit checks for exception types, now only checks for expected messages. Updated multiple test cases correspondingly. Also made minor alterations to error messages for better clarity.
The error message formatting has been adjusted for clarity in the misc.clj file. An extraneous check in the 'apply-generic-test' in the book_2_5_test.clj file has also been removed for improved simplicity.
@SmetDenis SmetDenis merged commit 03626ed into main Feb 11, 2024
7 checks passed
@SmetDenis SmetDenis deleted the improve-test-coverage branch February 11, 2024 21:52
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