Skip to content

Commit ff6d28a

Browse files
authored
run-length-encoding: Add the ability to select which tests to run (#882)
[no important files changed]
1 parent cb50ebd commit ff6d28a

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

exercises/practice/run-length-encoding/.meta/generator.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
run-length-encoding))
44

55
{{#test_cases.encode}}
6-
(deftest run-length-encode_test_{{idx}}
6+
(deftest ^:run-length-encode run-length-encode_test_{{idx}}
77
(testing {{context}}
88
(is (= {{expected}}
99
(run-length-encoding/run-length-encode {{input.string}})))))
1010
{{/test_cases.encode}}
1111

1212
{{#test_cases.decode}}
13-
(deftest run-length-decode_test_{{idx}}
13+
(deftest ^:run-length-decode run-length-decode_test_{{idx}}
1414
(testing {{context}}
1515
(is (= {{expected}}
1616
(run-length-encoding/run-length-decode {{input.string}})))))
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
(defproject run-length-encoding "0.1.0-SNAPSHOT"
22
:description "run-length-encoding exercise."
33
:url "https://github.com/exercism/clojure/tree/main/exercises/practice/run-length-encoding"
4-
:dependencies [[org.clojure/clojure "1.12.0"]])
4+
:dependencies [[org.clojure/clojure "1.12.0"]]
5+
:test-selectors {:run-length-encode :run-length-encode
6+
:run-length-decode :run-length-decode})

exercises/practice/run-length-encoding/test/run_length_encoding_test.clj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,62 @@
22
(:require [clojure.test :refer [deftest testing is]]
33
run-length-encoding))
44

5-
(deftest run-length-encode_test_1
5+
(deftest ^:run-length-encode run-length-encode_test_1
66
(testing "run-length encode a string ▶ empty string"
77
(is (= ""
88
(run-length-encoding/run-length-encode "")))))
99

10-
(deftest run-length-encode_test_2
10+
(deftest ^:run-length-encode run-length-encode_test_2
1111
(testing "run-length encode a string ▶ single characters only are encoded without count"
1212
(is (= "XYZ"
1313
(run-length-encoding/run-length-encode "XYZ")))))
1414

15-
(deftest run-length-encode_test_3
15+
(deftest ^:run-length-encode run-length-encode_test_3
1616
(testing "run-length encode a string ▶ string with no single characters"
1717
(is (= "2A3B4C"
1818
(run-length-encoding/run-length-encode "AABBBCCCC")))))
1919

20-
(deftest run-length-encode_test_4
20+
(deftest ^:run-length-encode run-length-encode_test_4
2121
(testing "run-length encode a string ▶ single characters mixed with repeated characters"
2222
(is (= "12WB12W3B24WB"
2323
(run-length-encoding/run-length-encode "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB")))))
2424

25-
(deftest run-length-encode_test_5
25+
(deftest ^:run-length-encode run-length-encode_test_5
2626
(testing "run-length encode a string ▶ multiple whitespace mixed in string"
2727
(is (= "2 hs2q q2w2 "
2828
(run-length-encoding/run-length-encode " hsqq qww ")))))
2929

30-
(deftest run-length-encode_test_6
30+
(deftest ^:run-length-encode run-length-encode_test_6
3131
(testing "run-length encode a string ▶ lowercase characters"
3232
(is (= "2a3b4c"
3333
(run-length-encoding/run-length-encode "aabbbcccc")))))
3434

35-
(deftest run-length-decode_test_1
35+
(deftest ^:run-length-decode run-length-decode_test_1
3636
(testing "run-length decode a string ▶ empty string"
3737
(is (= ""
3838
(run-length-encoding/run-length-decode "")))))
3939

40-
(deftest run-length-decode_test_2
40+
(deftest ^:run-length-decode run-length-decode_test_2
4141
(testing "run-length decode a string ▶ single characters only"
4242
(is (= "XYZ"
4343
(run-length-encoding/run-length-decode "XYZ")))))
4444

45-
(deftest run-length-decode_test_3
45+
(deftest ^:run-length-decode run-length-decode_test_3
4646
(testing "run-length decode a string ▶ string with no single characters"
4747
(is (= "AABBBCCCC"
4848
(run-length-encoding/run-length-decode "2A3B4C")))))
4949

50-
(deftest run-length-decode_test_4
50+
(deftest ^:run-length-decode run-length-decode_test_4
5151
(testing "run-length decode a string ▶ single characters with repeated characters"
5252
(is (= "WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWB"
5353
(run-length-encoding/run-length-decode "12WB12W3B24WB")))))
5454

55-
(deftest run-length-decode_test_5
55+
(deftest ^:run-length-decode run-length-decode_test_5
5656
(testing "run-length decode a string ▶ multiple whitespace mixed in string"
5757
(is (= " hsqq qww "
5858
(run-length-encoding/run-length-decode "2 hs2q q2w2 ")))))
5959

60-
(deftest run-length-decode_test_6
60+
(deftest ^:run-length-decode run-length-decode_test_6
6161
(testing "run-length decode a string ▶ lowercase string"
6262
(is (= "aabbbcccc"
6363
(run-length-encoding/run-length-decode "2a3b4c")))))

0 commit comments

Comments
 (0)