From 52c449efdcfd24969d6f5a34c257423391715bd8 Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:30:47 +0200 Subject: [PATCH 1/5] sync tests --- .../difference-of-squares/.meta/tests.toml | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/exercises/practice/difference-of-squares/.meta/tests.toml b/exercises/practice/difference-of-squares/.meta/tests.toml index 6fed93da4..e54414c0a 100644 --- a/exercises/practice/difference-of-squares/.meta/tests.toml +++ b/exercises/practice/difference-of-squares/.meta/tests.toml @@ -1,30 +1,37 @@ -# This is an auto-generated file. Regular comments will be removed when this -# file is regenerated. Regenerating will not touch any manually added keys, -# so comments can be added in a "comment" key. +# This is an auto-generated file. +# +# Regenerating this file via `configlet sync` will: +# - Recreate every `description` key/value pair +# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications +# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion) +# - Preserve any other key/value pair +# +# As user-added comments (using the # character) will be removed when this file +# is regenerated, comments can be added via a `comment` key. [e46c542b-31fc-4506-bcae-6b62b3268537] -description = "square of sum 1" +description = "Square the sum of the numbers up to the given number -> square of sum 1" [9b3f96cb-638d-41ee-99b7-b4f9c0622948] -description = "square of sum 5" +description = "Square the sum of the numbers up to the given number -> square of sum 5" [54ba043f-3c35-4d43-86ff-3a41625d5e86] -description = "square of sum 100" +description = "Square the sum of the numbers up to the given number -> square of sum 100" [01d84507-b03e-4238-9395-dd61d03074b5] -description = "sum of squares 1" +description = "Sum the squares of the numbers up to the given number -> sum of squares 1" [c93900cd-8cc2-4ca4-917b-dd3027023499] -description = "sum of squares 5" +description = "Sum the squares of the numbers up to the given number -> sum of squares 5" [94807386-73e4-4d9e-8dec-69eb135b19e4] -description = "sum of squares 100" +description = "Sum the squares of the numbers up to the given number -> sum of squares 100" [44f72ae6-31a7-437f-858d-2c0837adabb6] -description = "difference of squares 1" +description = "Subtract sum of squares from square of sums -> difference of squares 1" [005cb2bf-a0c8-46f3-ae25-924029f8b00b] -description = "difference of squares 5" +description = "Subtract sum of squares from square of sums -> difference of squares 5" [b1bf19de-9a16-41c0-a62b-1f02ecc0b036] -description = "difference of squares 100" +description = "Subtract sum of squares from square of sums -> difference of squares 100" From 9ebdb38db41840bb968e5d3ddd9e68618c214742 Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:31:12 +0200 Subject: [PATCH 2/5] implement tests --- .../test/difference_of_squares_test.clj | 49 +++++++++++-------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/exercises/practice/difference-of-squares/test/difference_of_squares_test.clj b/exercises/practice/difference-of-squares/test/difference_of_squares_test.clj index 2355c8f60..740efd533 100644 --- a/exercises/practice/difference-of-squares/test/difference_of_squares_test.clj +++ b/exercises/practice/difference-of-squares/test/difference_of_squares_test.clj @@ -1,30 +1,39 @@ (ns difference-of-squares-test - (:require [clojure.test :refer [deftest is]] - [difference-of-squares :as dos])) + (:require [clojure.test :refer [deftest testing is]] + difference-of-squares)) -(deftest square-of-sum-to-5 - (is (= 225 (dos/square-of-sum 5)))) +(deftest test-e46c542b-31fc-4506-bcae-6b62b3268537 + (testing "Square the sum of the numbers up to the given number -> square of sum 1" + (is (= 1 (difference-of-squares/square-of-sum 1))))) -(deftest sum-of-squares-to-5 - (is (= 55 (dos/sum-of-squares 5)))) +(deftest test-9b3f96cb-638d-41ee-99b7-b4f9c0622948 + (testing "Square the sum of the numbers up to the given number -> square of sum 5" + (is (= 225 (difference-of-squares/square-of-sum 5))))) -(deftest difference-of-squares-to-5 - (is (= 170 (dos/difference 5)))) +(deftest test-54ba043f-3c35-4d43-86ff-3a41625d5e86 + (testing "Square the sum of the numbers up to the given number -> square of sum 100" + (is (= 25502500 (difference-of-squares/square-of-sum 100))))) -(deftest square-of-sum-to-10 - (is (= 3025 (dos/square-of-sum 10)))) +(deftest test-01d84507-b03e-4238-9395-dd61d03074b5 + (testing "Sum the squares of the numbers up to the given number -> sum of squares 1" + (is (= 1 (difference-of-squares/sum-of-squares 1))))) -(deftest sum-of-squares-to-10 - (is (= 385 (dos/sum-of-squares 10)))) +(deftest test-c93900cd-8cc2-4ca4-917b-dd3027023499 + (testing "Sum the squares of the numbers up to the given number -> sum of squares 5" + (is (= 55 (difference-of-squares/sum-of-squares 5))))) -(deftest difference-of-squares-to-10 - (is (= 2640 (dos/difference 10)))) +(deftest test-94807386-73e4-4d9e-8dec-69eb135b19e4 + (testing "Sum the squares of the numbers up to the given number -> sum of squares 100" + (is (= 338350 (difference-of-squares/sum-of-squares 100))))) -(deftest square-of-sum-to-100 - (is (= 25502500 (dos/square-of-sum 100)))) +(deftest test-44f72ae6-31a7-437f-858d-2c0837adabb6 + (testing "Subtract sum of squares from square of sums -> difference of squares 1" + (is (= 0 (difference-of-squares/difference 1))))) -(deftest sum-of-squares-to-100 - (is (= 338350 (dos/sum-of-squares 100)))) +(deftest test-005cb2bf-a0c8-46f3-ae25-924029f8b00b + (testing "Subtract sum of squares from square of sums -> difference of squares 5" + (is (= 170 (difference-of-squares/difference 5))))) -(deftest difference-of-squares-to-100 - (is (= 25164150 (dos/difference 100)))) +(deftest test-b1bf19de-9a16-41c0-a62b-1f02ecc0b036 + (testing "Subtract sum of squares from square of sums -> difference of squares 100" + (is (= 25164150 (difference-of-squares/difference 100))))) From 24310b1deb03f39669b67a30de14f75937163435 Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Sat, 2 Nov 2024 20:39:14 +0200 Subject: [PATCH 3/5] update starter file --- .../src/difference_of_squares.clj | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/exercises/practice/difference-of-squares/src/difference_of_squares.clj b/exercises/practice/difference-of-squares/src/difference_of_squares.clj index 5200bdcd1..dd52819c1 100644 --- a/exercises/practice/difference-of-squares/src/difference_of_squares.clj +++ b/exercises/practice/difference-of-squares/src/difference_of_squares.clj @@ -1,13 +1,19 @@ (ns difference-of-squares) -(defn difference [] ;; <- arglist goes here - ;; your code goes here -) +(defn square-of-sum + "Returns the square of the sum of the numbers up to the given number" + [n] + ;; function body + ) -(defn sum-of-squares [] ;; <- arglist goes here - ;; your code goes here -) +(defn sum-of-squares + "Returns the sum of the squares of the numbers up to the given number" + [n] + ;; function body + ) -(defn square-of-sum [] ;; <- arglist goes here - ;; your code goes here -) +(defn difference + "Returns the difference between the square of the sum of numbers up to a given number and the sum of the squares of those numbers" + [n] + ;; function body + ) From bfbffbe95dd7b441a7cf59693813257e94e5afed Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:20:24 +0200 Subject: [PATCH 4/5] update config --- exercises/practice/difference-of-squares/.meta/config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/practice/difference-of-squares/.meta/config.json b/exercises/practice/difference-of-squares/.meta/config.json index acac3c661..864e4bbb1 100644 --- a/exercises/practice/difference-of-squares/.meta/config.json +++ b/exercises/practice/difference-of-squares/.meta/config.json @@ -11,7 +11,8 @@ "mathias", "rubysolo", "Scientifica96", - "yurrriq" + "yurrriq", + "tasxatzial" ], "files": { "solution": [ From 77c23699dbeff4109737e87d5d3dacfa2b4c3870 Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Sat, 11 Jan 2025 02:22:11 +0200 Subject: [PATCH 5/5] rename test functions --- .../test/difference_of_squares_test.clj | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exercises/practice/difference-of-squares/test/difference_of_squares_test.clj b/exercises/practice/difference-of-squares/test/difference_of_squares_test.clj index 740efd533..a90658705 100644 --- a/exercises/practice/difference-of-squares/test/difference_of_squares_test.clj +++ b/exercises/practice/difference-of-squares/test/difference_of_squares_test.clj @@ -2,38 +2,38 @@ (:require [clojure.test :refer [deftest testing is]] difference-of-squares)) -(deftest test-e46c542b-31fc-4506-bcae-6b62b3268537 +(deftest square-of-sum_test_1 (testing "Square the sum of the numbers up to the given number -> square of sum 1" (is (= 1 (difference-of-squares/square-of-sum 1))))) -(deftest test-9b3f96cb-638d-41ee-99b7-b4f9c0622948 +(deftest square-of-sum_test_2 (testing "Square the sum of the numbers up to the given number -> square of sum 5" (is (= 225 (difference-of-squares/square-of-sum 5))))) -(deftest test-54ba043f-3c35-4d43-86ff-3a41625d5e86 +(deftest square-of-sum_test_3 (testing "Square the sum of the numbers up to the given number -> square of sum 100" (is (= 25502500 (difference-of-squares/square-of-sum 100))))) -(deftest test-01d84507-b03e-4238-9395-dd61d03074b5 +(deftest sum-of-squares_test_1 (testing "Sum the squares of the numbers up to the given number -> sum of squares 1" (is (= 1 (difference-of-squares/sum-of-squares 1))))) -(deftest test-c93900cd-8cc2-4ca4-917b-dd3027023499 +(deftest sum-of-squares_test_2 (testing "Sum the squares of the numbers up to the given number -> sum of squares 5" (is (= 55 (difference-of-squares/sum-of-squares 5))))) -(deftest test-94807386-73e4-4d9e-8dec-69eb135b19e4 +(deftest sum-of-squares_test_3 (testing "Sum the squares of the numbers up to the given number -> sum of squares 100" (is (= 338350 (difference-of-squares/sum-of-squares 100))))) -(deftest test-44f72ae6-31a7-437f-858d-2c0837adabb6 +(deftest difference_test_1 (testing "Subtract sum of squares from square of sums -> difference of squares 1" (is (= 0 (difference-of-squares/difference 1))))) -(deftest test-005cb2bf-a0c8-46f3-ae25-924029f8b00b +(deftest difference_test_2 (testing "Subtract sum of squares from square of sums -> difference of squares 5" (is (= 170 (difference-of-squares/difference 5))))) -(deftest test-b1bf19de-9a16-41c0-a62b-1f02ecc0b036 +(deftest difference_test_3 (testing "Subtract sum of squares from square of sums -> difference of squares 100" (is (= 25164150 (difference-of-squares/difference 100)))))