Skip to content

Commit 3661f25

Browse files
Update resistor_color_duo.clj
Co-authored-by: Anastasios Chatzialexiou <[email protected]>
1 parent 63e89f7 commit 3661f25

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

exercises/practice/resistor-color-duo/.meta/example.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
(defn- color-code [color] (.indexOf colors color))
66

7-
(defn value
7+
(defn resistor-value
88
"Returns the resistor value based on the given colors"
99
[[color-1 color-2]]
1010
(+ (* 10 (color-code color-1)) (color-code color-2)))

exercises/practice/resistor-color-duo/.meta/generator.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
(:require [clojure.test :refer [deftest testing is]]
33
resistor-color-duo))
44
{{#test_cases.value}}
5-
(deftest value_test_{{idx}}
5+
(deftest resistor-value_test_{{idx}}
66
(testing {{description}}
7-
(is (= {{expected}} (resistor-color-duo/value {{input.colors}})))))
7+
(is (= {{expected}} (resistor-color-duo/resistor-value {{input.colors}})))))
88
{{/test_cases.value~}}

exercises/practice/resistor-color-duo/src/resistor_color_duo.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(ns resistor-color-duo)
22

3-
(defn value
3+
(defn resistor-value
44
"Returns the resistor value based on the given colors"
55
[colors]
66
;; function body

exercises/practice/resistor-color-duo/test/resistor_color_duo_test.clj

+14-14
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22
(:require [clojure.test :refer [deftest testing is]]
33
resistor-color-duo))
44

5-
(deftest value_test_1
5+
(deftest resistor-value_test_1
66
(testing "Brown and black"
7-
(is (= 10 (resistor-color-duo/value ["brown" "black"])))))
7+
(is (= 10 (resistor-color-duo/resistor-value ["brown" "black"])))))
88

9-
(deftest value_test_2
9+
(deftest resistor-value_test_2
1010
(testing "Blue and grey"
11-
(is (= 68 (resistor-color-duo/value ["blue" "grey"])))))
11+
(is (= 68 (resistor-color-duo/resistor-value ["blue" "grey"])))))
1212

13-
(deftest value_test_3
13+
(deftest resistor-value_test_3
1414
(testing "Yellow and violet"
15-
(is (= 47 (resistor-color-duo/value ["yellow" "violet"])))))
15+
(is (= 47 (resistor-color-duo/resistor-value ["yellow" "violet"])))))
1616

17-
(deftest value_test_4
17+
(deftest resistor-value_test_4
1818
(testing "White and red"
19-
(is (= 92 (resistor-color-duo/value ["white" "red"])))))
19+
(is (= 92 (resistor-color-duo/resistor-value ["white" "red"])))))
2020

21-
(deftest value_test_5
21+
(deftest resistor-value_test_5
2222
(testing "Orange and orange"
23-
(is (= 33 (resistor-color-duo/value ["orange" "orange"])))))
23+
(is (= 33 (resistor-color-duo/resistor-value ["orange" "orange"])))))
2424

25-
(deftest value_test_6
25+
(deftest resistor-value_test_6
2626
(testing "Ignore additional colors"
27-
(is (= 51 (resistor-color-duo/value ["green" "brown" "orange"])))))
27+
(is (= 51 (resistor-color-duo/resistor-value ["green" "brown" "orange"])))))
2828

29-
(deftest value_test_7
29+
(deftest resistor-value_test_7
3030
(testing "Black and brown, one-digit"
31-
(is (= 1 (resistor-color-duo/value ["black" "brown"])))))
31+
(is (= 1 (resistor-color-duo/resistor-value ["black" "brown"])))))

0 commit comments

Comments
 (0)