Skip to content

Commit fc04ebd

Browse files
authored
high-scores: Add the ability to select which tests to run (#888)
[no important files changed]
1 parent 9224a70 commit fc04ebd

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

exercises/practice/high-scores/.meta/generator.tpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
high-scores))
44

55
{{#test_cases.scores}}
6-
(deftest scores_test_{{idx}}
6+
(deftest ^:scores scores_test_{{idx}}
77
(testing {{context}}
88
(is (= {{expected}} (high-scores/scores {{input.scores}})))))
99
{{/test_cases.scores}}
1010

1111
{{#test_cases.latest}}
12-
(deftest latest_test_{{idx}}
12+
(deftest ^:latest latest_test_{{idx}}
1313
(testing {{context}}
1414
(is (= {{expected}} (high-scores/latest {{input.scores}})))))
1515
{{/test_cases.latest}}
1616

1717
{{#test_cases.personalBest}}
18-
(deftest personal-best_test_{{idx}}
18+
(deftest ^:personal-best personal-best_test_{{idx}}
1919
(testing {{context}}
2020
(is (= {{expected}} (high-scores/personal-best {{input.scores}})))))
2121
{{/test_cases.personalBest}}
2222

2323
{{#test_cases.personalTopThree}}
24-
(deftest personal-top-three_test_{{idx}}
24+
(deftest ^:personal-top-three personal-top-three_test_{{idx}}
2525
(testing {{context}}
2626
(is (= {{expected}} (high-scores/personal-top-three {{input.scores}})))))
2727
{{/test_cases.personalTopThree}}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(defproject high-scores "0.1.0-SNAPSHOT"
2+
:description "high-scores exercise."
3+
:url "https://github.com/exercism/clojure/tree/master/exercises/high-scores"
4+
:dependencies [[org.clojure/clojure "1.12.0"]]
5+
:test-selectors {:scores :scores
6+
:latest :latest
7+
:personal-best :personal-best
8+
:personal-top-three :personal-top-three})

exercises/practice/high-scores/project.edn

Lines changed: 0 additions & 4 deletions
This file was deleted.

exercises/practice/high-scores/test/high_scores_test.clj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22
(:require [clojure.test :refer [deftest testing is]]
33
high-scores))
44

5-
(deftest scores_test_1
5+
(deftest ^:scores scores_test_1
66
(testing "List of scores"
77
(is (= '(30 50 20 70) (high-scores/scores '(30 50 20 70))))))
88

9-
(deftest latest_test_1
9+
(deftest ^:latest latest_test_1
1010
(testing "Latest score"
1111
(is (= 30 (high-scores/latest '(100 0 90 30))))))
1212

13-
(deftest personal-best_test_1
13+
(deftest ^:personal-best personal-best_test_1
1414
(testing "Personal best"
1515
(is (= 100 (high-scores/personal-best '(40 100 70))))))
1616

17-
(deftest personal-top-three_test_1
17+
(deftest ^:personal-top-three personal-top-three_test_1
1818
(testing "Top 3 scores ▶ Personal top three from a list of scores"
1919
(is (= '(100 90 70) (high-scores/personal-top-three '(10 30 90 30 100 20 10 0 30 40 40 70 70))))))
2020

21-
(deftest personal-top-three_test_2
21+
(deftest ^:personal-top-three personal-top-three_test_2
2222
(testing "Top 3 scores ▶ Personal top highest to lowest"
2323
(is (= '(30 20 10) (high-scores/personal-top-three '(20 10 30))))))
2424

25-
(deftest personal-top-three_test_3
25+
(deftest ^:personal-top-three personal-top-three_test_3
2626
(testing "Top 3 scores ▶ Personal top when there is a tie"
2727
(is (= '(40 40 30) (high-scores/personal-top-three '(40 20 40 30))))))
2828

29-
(deftest personal-top-three_test_4
29+
(deftest ^:personal-top-three personal-top-three_test_4
3030
(testing "Top 3 scores ▶ Personal top when there are less than 3"
3131
(is (= '(70 30) (high-scores/personal-top-three '(30 70))))))
3232

33-
(deftest personal-top-three_test_5
33+
(deftest ^:personal-top-three personal-top-three_test_5
3434
(testing "Top 3 scores ▶ Personal top when there is only one"
3535
(is (= '(40) (high-scores/personal-top-three '(40))))))

0 commit comments

Comments
 (0)