-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enhance test coverage * Remove splint from lint sequence in bb.edn 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. * Refactor complex number functionality and add tests 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. * Reformat imports in book_2_4_test.clj 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. * Refactor exception handling across multiple test files 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. * Modify exception checking in tests 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. * Correct naming for test coverage workflow 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. * Add test files for ex-2-73 and ex-2-75 and improve derivation functions 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. * Update clj-kondo configuration and clojure.test import 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. * Update clj-kondo settings and refactor test file imports 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_ * Refactor exception handling and update test cases 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. * Refactor error message formatting in misc.clj 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.
- Loading branch information
Showing
28 changed files
with
359 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/sicp/chapter_1/part_1/ex_1_3_test.clj → test/sicp/chapter_1/part_1/ex_1_03_test.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/sicp/chapter_1/part_1/ex_1_4_test.clj → test/sicp/chapter_1/part_1/ex_1_04_test.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/sicp/chapter_1/part_1/ex_1_6_test.clj → test/sicp/chapter_1/part_1/ex_1_06_test.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/sicp/chapter_1/part_1/ex_1_7_test.clj → test/sicp/chapter_1/part_1/ex_1_07_test.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/sicp/chapter_1/part_1/ex_1_8_test.clj → test/sicp/chapter_1/part_1/ex_1_08_test.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 5 additions & 3 deletions
8
test/sicp/chapter_1/part_2/ex_1_9_test.clj → test/sicp/chapter_1/part_2/ex_1_09_test.clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
(ns sicp.chapter-1.part-2.ex-1-9-test | ||
(ns sicp.chapter-1.part-2.ex-1-09-test | ||
(:require | ||
[clojure.test :refer [deftest is]] | ||
[sicp.chapter-1.part-2.ex-1-09 :refer [plus plus-v2]])) | ||
|
||
(deftest plus-test | ||
(is (= 3 (plus 1 2)))) | ||
(is (= 3 (plus 1 2))) | ||
(is (= 2 (plus 0 2)))) | ||
|
||
(deftest plus-v2-test | ||
(is (= 3 (plus-v2 1 2)))) | ||
(is (= 3 (plus-v2 1 2))) | ||
(is (= 2 (plus-v2 0 2)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.