From 2f2976aed9a522febfbd5b668cbaae708ab71bc8 Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Sat, 2 Nov 2024 19:58:20 +0200 Subject: [PATCH 1/3] update starter file --- exercises/practice/etl/src/etl.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/exercises/practice/etl/src/etl.clj b/exercises/practice/etl/src/etl.clj index c493d5e7..333b1057 100644 --- a/exercises/practice/etl/src/etl.clj +++ b/exercises/practice/etl/src/etl.clj @@ -1,5 +1,6 @@ (ns etl) -(defn transform [source] ;; <- arglist goes here - ;; your code goes here -) +(defn transform + [source] + ;; function body + ) From 1a9dedcbf140e3c97141d4446a33a754105fc348 Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Sat, 2 Nov 2024 20:17:21 +0200 Subject: [PATCH 2/3] implement tests --- exercises/practice/etl/test/etl_test.clj | 52 +++++++++++++----------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/exercises/practice/etl/test/etl_test.clj b/exercises/practice/etl/test/etl_test.clj index 29d02567..af980a1e 100644 --- a/exercises/practice/etl/test/etl_test.clj +++ b/exercises/practice/etl/test/etl_test.clj @@ -1,30 +1,34 @@ (ns etl-test - (:require [clojure.test :refer [deftest is]] + (:require [clojure.test :refer [deftest testing is]] etl)) -(deftest transform-one-value - (is (= {"world" 1} - (etl/transform {1 ["WORLD"]})))) +(deftest test-78a7a9f9-4490-4a47-8ee9-5a38bb47d28f + (testing "Single letter" + (is (= {"a" 1} + (etl/transform {1 ["A"]}))))) -(deftest transform-more-values - (is (= {"world" 1 "gschoolers" 1} - (etl/transform {1 ["WORLD" "GSCHOOLERS"]})))) +(deftest test-60dbd000-451d-44c7-bdbb-97c73ac1f497 + (testing "Single score with multiple letters" + (is (= {"a" 1 "e" 1 "i" 1 "o" 1 "u" 1} + (etl/transform {1 ["A" "E" "I" "O" "U"]}))))) -(deftest more-keys - (is (= {"apple" 1 "artichoke" 1 "boat" 2 "ballerina" 2} - (etl/transform {1 ["APPLE" "ARTICHOKE"], 2 ["BOAT" "BALLERINA"]})))) +(deftest test-f5c5de0c-301f-4fdd-a0e5-df97d4214f54 + (testing "Multiple scores with multiple letters" + (is (= {"a" 1 "d" 2 "e" 1 "g" 2} + (etl/transform {1 ["A" "E"], 2 ["D" "G"]}))))) -(deftest full-dataset - (is (= {"a" 1 "b" 3 "c" 3 "d" 2 "e" 1 - "f" 4 "g" 2 "h" 4 "i" 1 "j" 8 - "k" 5 "l" 1 "m" 3 "n" 1 "o" 1 - "p" 3 "q" 10 "r" 1 "s" 1 "t" 1 - "u" 1 "v" 4 "w" 4 "x" 8 "y" 4 - "z" 10} - (etl/transform {1 (re-seq #"\w" "AEIOULNRST") - 2 (re-seq #"\w" "DG") - 3 (re-seq #"\w" "BCMP") - 4 (re-seq #"\w" "FHVWY") - 5 (re-seq #"\w" "K") - 8 (re-seq #"\w" "JX") - 10 (re-seq #"\w" "QZ")})))) +(deftest test-5db8ea89-ecb4-4dcd-902f-2b418cc87b9d + (testing "Multiple scores with differing numbers of letters" + (is (= {"a" 1 "b" 3 "c" 3 "d" 2 "e" 1 + "f" 4 "g" 2 "h" 4 "i" 1 "j" 8 + "k" 5 "l" 1 "m" 3 "n" 1 "o" 1 + "p" 3 "q" 10 "r" 1 "s" 1 "t" 1 + "u" 1 "v" 4 "w" 4 "x" 8 "y" 4 + "z" 10} + (etl/transform {1 ["A" "E" "I" "O" "U" "L" "N" "R" "S" "T"] + 2 ["D" "G"] + 3 ["B" "C" "M" "P"] + 4 ["F" "H" "V" "W" "Y"] + 5 ["K"] + 8 ["J" "X"] + 10 ["Q" "Z"]}))))) From 0d3e37d52544ff28a0ca366d45b860df29cd209f Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Fri, 8 Nov 2024 11:21:25 +0200 Subject: [PATCH 3/3] update config --- exercises/practice/etl/.meta/config.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exercises/practice/etl/.meta/config.json b/exercises/practice/etl/.meta/config.json index c3135dd7..790fb4e2 100644 --- a/exercises/practice/etl/.meta/config.json +++ b/exercises/practice/etl/.meta/config.json @@ -14,7 +14,8 @@ "mathias", "rsslldnphy", "sjwarner-bp", - "yurrriq" + "yurrriq", + "tasxatzial" ], "files": { "solution": [