Skip to content

Commit 7e5790b

Browse files
authored
interest-is-interesting: Add the ability to select which tests to run (#869)
1 parent e1e9c19 commit 7e5790b

2 files changed

Lines changed: 34 additions & 28 deletions

File tree

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
(defproject interest-is-interesting "0.1.0-SNAPSHOT"
22
:description "interest-is-interesting exercise."
33
:url "https://github.com/exercism/clojure/tree/main/exercises/concept/interest-is-interesting"
4-
:dependencies [[org.clojure/clojure "1.12.0"]])
4+
:dependencies [[org.clojure/clojure "1.12.0"]]
5+
:test-selectors {:task-1 :task-1
6+
:task-2 :task-2
7+
:task-3 :task-3
8+
:interest-rate :interest-rate
9+
:annual-balance-update :annual-balance-update
10+
:amount-to-donate :amount-to-donate})

exercises/concept/interest-is-interesting/test/interest_is_interesting_test.clj

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,83 +2,83 @@
22
(:require [clojure.test :refer [deftest is]]
33
interest-is-interesting))
44

5-
(deftest ^{:task 1} minimal-first-interest-rate-test
5+
(deftest ^{:task 1 :task-1 true :interest-rate true} minimal-first-interest-rate-test
66
(is (= 0.5 (interest-is-interesting/interest-rate 0M))))
77

8-
(deftest ^{:task 1} tiny-first-interest-rate-test
8+
(deftest ^{:task 1 :task-1 true :interest-rate true} tiny-first-interest-rate-test
99
(is (= 0.5 (interest-is-interesting/interest-rate 0.000001M))))
1010

11-
(deftest ^{:task 1} maximum-first-interest-rate-test
11+
(deftest ^{:task 1 :task-1 true :interest-rate true} maximum-first-interest-rate-test
1212
(is (= 0.5 (interest-is-interesting/interest-rate 999.9999M))))
1313

14-
(deftest ^{:task 1} minimal-second-interest-rate-test
14+
(deftest ^{:task 1 :task-1 true :interest-rate true} minimal-second-interest-rate-test
1515
(is (= 1.621 (interest-is-interesting/interest-rate 1000.0M))))
1616

17-
(deftest ^{:task 1} tiny-second-interest-rate-test
17+
(deftest ^{:task 1 :task-1 true :interest-rate true} tiny-second-interest-rate-test
1818
(is (= 1.621 (interest-is-interesting/interest-rate 1000.0001M))))
1919

20-
(deftest ^{:task 1} maximum-second-interest-rate-test
20+
(deftest ^{:task 1 :task-1 true :interest-rate true} maximum-second-interest-rate-test
2121
(is (= 1.621 (interest-is-interesting/interest-rate 4999.9990M))))
2222

23-
(deftest ^{:task 1} minimal-third-interest-rate-test
23+
(deftest ^{:task 1 :task-1 true :interest-rate true} minimal-third-interest-rate-test
2424
(is (= 2.475 (interest-is-interesting/interest-rate 5000.0000M))))
2525

26-
(deftest ^{:task 1} tiny-third-interest-rate-test
26+
(deftest ^{:task 1 :task-1 true :interest-rate true} tiny-third-interest-rate-test
2727
(is (= 2.475 (interest-is-interesting/interest-rate 5000.0001M))))
2828

29-
(deftest ^{:task 1} large-third-interest-rate-test
29+
(deftest ^{:task 1 :task-1 true :interest-rate true} large-third-interest-rate-test
3030
(is (= 2.475 (interest-is-interesting/interest-rate 5639998.742909M))))
3131

32-
(deftest ^{:task 1} minimal-negative-interest-rate-test
32+
(deftest ^{:task 1 :task-1 true :interest-rate true} minimal-negative-interest-rate-test
3333
(is (= -3.213 (interest-is-interesting/interest-rate -0.000001M))))
3434

35-
(deftest ^{:task 1} small-negative-interest-rate-test
35+
(deftest ^{:task 1 :task-1 true :interest-rate true} small-negative-interest-rate-test
3636
(is (= -3.213 (interest-is-interesting/interest-rate -0.123M))))
3737

38-
(deftest ^{:task 1} regular-negative-interest-rate-test
38+
(deftest ^{:task 1 :task-1 true :interest-rate true} regular-negative-interest-rate-test
3939
(is (= -3.213 (interest-is-interesting/interest-rate -300.0M))))
4040

41-
(deftest ^{:task 1} large-negative-interest-rate-test
41+
(deftest ^{:task 1 :task-1 true :interest-rate true} large-negative-interest-rate-test
4242
(is (= -3.213 (interest-is-interesting/interest-rate -152964.231M))))
4343

44-
(deftest ^{:task 2} annual-balance-update-empty-balance-test
44+
(deftest ^{:task 2 :task-2 true :annual-balance-update true} annual-balance-update-empty-balance-test
4545
(is (= 0.0000M (interest-is-interesting/annual-balance-update 0.0M))))
4646

47-
(deftest ^{:task 2} annual-balance-update-small-positive-balance-test
47+
(deftest ^{:task 2 :task-2 true :annual-balance-update true} annual-balance-update-small-positive-balance-test
4848
(is (= 0.000001005M (interest-is-interesting/annual-balance-update 0.000001M))))
4949

50-
(deftest ^{:task 2} annual-balance-update-average-positive-balance-test
50+
(deftest ^{:task 2 :task-2 true :annual-balance-update true} annual-balance-update-average-positive-balance-test
5151
(is (= 1016.210000M (interest-is-interesting/annual-balance-update 1000.0M))))
5252

53-
(deftest ^{:task 2} annual-balance-update-large-positive-balance-test
53+
(deftest ^{:task 2 :task-2 true :annual-balance-update true} annual-balance-update-large-positive-balance-test
5454
(is (= 1016.210101621M (interest-is-interesting/annual-balance-update 1000.0001M))))
5555

56-
(deftest ^{:task 2} annual-balance-update-huge-positive-balance-test
56+
(deftest ^{:task 2 :task-2 true :annual-balance-update true} annual-balance-update-huge-positive-balance-test
5757
(is (= 920352587.26744292868451875M (interest-is-interesting/annual-balance-update 898124017.826243404425M))))
5858

59-
(deftest ^{:task 2} annual-balance-update-small-negative-balance-test
59+
(deftest ^{:task 2 :task-2 true :annual-balance-update true} annual-balance-update-small-negative-balance-test
6060
(is (= -0.12695199M (interest-is-interesting/annual-balance-update -0.123M))))
6161

62-
(deftest ^{:task 2} annual-balance-update-large-negative-balance-test
62+
(deftest ^{:task 2 :task-2 true :annual-balance-update true} annual-balance-update-large-negative-balance-test
6363
(is (= -157878.97174203M (interest-is-interesting/annual-balance-update -152964.231M))))
6464

65-
(deftest ^{:task 3} amount-to-donate-empty-balance-test
65+
(deftest ^{:task 3 :task-3 true :amount-to-donate true} amount-to-donate-empty-balance-test
6666
(is (= 0 (interest-is-interesting/amount-to-donate 0.0M 2.0))))
6767

68-
(deftest ^{:task 3} amount-to-donate-small-positive-balance-test
68+
(deftest ^{:task 3 :task-3 true :amount-to-donate true} amount-to-donate-small-positive-balance-test
6969
(is (= 0 (interest-is-interesting/amount-to-donate 0.000001M 2.1))))
7070

71-
(deftest ^{:task 3} amount-to-donate-average-positive-balance-test
71+
(deftest ^{:task 3 :task-3 true :amount-to-donate true} amount-to-donate-average-positive-balance-test
7272
(is (= 40 (interest-is-interesting/amount-to-donate 1000.0M 2.0))))
7373

74-
(deftest ^{:task 3} amount-to-donate-large-positive-balance-test
74+
(deftest ^{:task 3 :task-3 true :amount-to-donate true} amount-to-donate-large-positive-balance-test
7575
(is (= 19 (interest-is-interesting/amount-to-donate 1000.0001M 0.99))))
7676

77-
(deftest ^{:task 3} amount-to-donate-huge-positive-balance-test
77+
(deftest ^{:task 3 :task-3 true :amount-to-donate true} amount-to-donate-huge-positive-balance-test
7878
(is (= 47600572 (interest-is-interesting/amount-to-donate 898124017.826243404425M 2.65))))
7979

80-
(deftest ^{:task 3} amount-to-donate-small-negative-balance-test
80+
(deftest ^{:task 3 :task-3 true :amount-to-donate true} amount-to-donate-small-negative-balance-test
8181
(is (= 0 (interest-is-interesting/amount-to-donate -0.123M 3.33))))
8282

83-
(deftest ^{:task 3} amount-to-donate-large-negative-balance-test
83+
(deftest ^{:task 3 :task-3 true :amount-to-donate true} amount-to-donate-large-negative-balance-test
8484
(is (= 0 (interest-is-interesting/amount-to-donate -152964.231M 5.4))))

0 commit comments

Comments
 (0)