Skip to content

Commit 524a6b4

Browse files
authored
Update tests for pangram, roman-numerals, and triangle (#246)
* Update pangram tests * Update roman-numeral tests * Update triangle tests * Fix incorrect test in roman-numerals test
1 parent 5240a2d commit 524a6b4

File tree

6 files changed

+200
-128
lines changed

6 files changed

+200
-128
lines changed

exercises/practice/pangram/.meta/tests.toml

+5
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,8 @@ description = "mixed case and punctuation"
3838

3939
[2577bf54-83c8-402d-a64b-a2c0f7bb213a]
4040
description = "case insensitive"
41+
include = false
42+
43+
[7138e389-83e4-4c6e-8413-1e40a0076951]
44+
description = "a-m and A-M are 26 different characters but not a pangram"
45+
reimplements = "2577bf54-83c8-402d-a64b-a2c0f7bb213a"
+15-18
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,34 @@
1-
"
2-
" Version: 1.1.0
3-
"
4-
5-
Before:
6-
unlet! input expected
7-
8-
Execute (sentence empty):
1+
Execute (empty sentence):
92
let input = ""
103
let expected = 0
114
AssertEqual expected, IsPangram(input)
125

13-
Execute (pangram with only lower case):
6+
Execute (perfect lower case):
7+
let input = "abcdefghijklmnopqrstuvwxyz"
8+
let expected = 1
9+
AssertEqual expected, IsPangram(input)
10+
11+
Execute (only lower case):
1412
let input = "the quick brown fox jumps over the lazy dog"
1513
let expected = 1
1614
AssertEqual expected, IsPangram(input)
1715

18-
Execute (missing character 'x'):
16+
Execute (missing the letter 'x'):
1917
let input = "a quick movement of the enemy will jeopardize five gunboats"
2018
let expected = 0
2119
AssertEqual expected, IsPangram(input)
2220

23-
Execute (another missing character 'x'):
24-
let input = "the quick brown fish jumps over the lazy dog"
21+
Execute (missing the letter 'h'):
22+
let input = "five boxing wizards jump quickly at it"
2523
let expected = 0
2624
AssertEqual expected, IsPangram(input)
2725

28-
Execute (pangram with underscores):
26+
Execute (with underscores):
2927
let input = "the_quick_brown_fox_jumps_over_the_lazy_dog"
3028
let expected = 1
3129
AssertEqual expected, IsPangram(input)
3230

33-
Execute (pangram with numbers):
31+
Execute (with numbers):
3432
let input = "the 1 quick brown fox jumps over the 2 lazy dogs"
3533
let expected = 1
3634
AssertEqual expected, IsPangram(input)
@@ -40,13 +38,12 @@ Execute (missing letters replaced by numbers):
4038
let expected = 0
4139
AssertEqual expected, IsPangram(input)
4240

43-
Execute (pangram with mixed case and punctuation):
41+
Execute (mixed case and punctuation):
4442
let input = "\"Five quacking Zephyrs jolt my wax bed.\""
4543
let expected = 1
4644
AssertEqual expected, IsPangram(input)
4745

48-
Execute (upper and lower case versions of the same character should not be counted separately):
49-
let input = "the quick brown fox jumps over with lazy FX"
46+
Execute (a-m and A-M are 26 different characters but not a pangram):
47+
let input = "abcdefghijklm ABCDEFGHIJKLM"
5048
let expected = 0
5149
AssertEqual expected, IsPangram(input)
52-

exercises/practice/roman-numerals/.meta/tests.toml

+21
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ description = "6 is VI"
3030
[ff3fb08c-4917-4aab-9f4e-d663491d083d]
3131
description = "9 is IX"
3232

33+
[6d1d82d5-bf3e-48af-9139-87d7165ed509]
34+
description = "16 is XVI"
35+
3336
[2bda64ca-7d28-4c56-b08d-16ce65716cf6]
3437
description = "27 is XXVII"
3538

@@ -42,6 +45,9 @@ description = "49 is XLIX"
4245
[d5b283d4-455d-4e68-aacf-add6c4b51915]
4346
description = "59 is LIX"
4447

48+
[4465ffd5-34dc-44f3-ada5-56f5007b6dad]
49+
description = "66 is LXVI"
50+
4551
[46b46e5b-24da-4180-bfe2-2ef30b39d0d0]
4652
description = "93 is XCIII"
4753

@@ -51,17 +57,32 @@ description = "141 is CXLI"
5157
[267f0207-3c55-459a-b81d-67cec7a46ed9]
5258
description = "163 is CLXIII"
5359

60+
[902ad132-0b4d-40e3-8597-ba5ed611dd8d]
61+
description = "166 is CLXVI"
62+
5463
[cdb06885-4485-4d71-8bfb-c9d0f496b404]
5564
description = "402 is CDII"
5665

5766
[6b71841d-13b2-46b4-ba97-dec28133ea80]
5867
description = "575 is DLXXV"
5968

69+
[dacb84b9-ea1c-4a61-acbb-ce6b36674906]
70+
description = "666 is DCLXVI"
71+
6072
[432de891-7fd6-4748-a7f6-156082eeca2f]
6173
description = "911 is CMXI"
6274

6375
[e6de6d24-f668-41c0-88d7-889c0254d173]
6476
description = "1024 is MXXIV"
6577

78+
[efbe1d6a-9f98-4eb5-82bc-72753e3ac328]
79+
description = "1666 is MDCLXVI"
80+
6681
[bb550038-d4eb-4be2-a9ce-f21961ac3bc6]
6782
description = "3000 is MMM"
83+
84+
[3bc4b41c-c2e6-49d9-9142-420691504336]
85+
description = "3001 is MMMI"
86+
87+
[4e18e96b-5fbb-43df-a91b-9cb511fe0856]
88+
description = "3999 is MMMCMXCIX"
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,77 @@
1-
Execute (1 is a single I):
1+
Execute (1 is I):
22
AssertEqual 'I', ToRoman(1)
33

4-
Execute (2 is two I's):
4+
Execute (2 is II):
55
AssertEqual 'II', ToRoman(2)
66

7-
Execute (2 is three I's):
7+
Execute (3 is III):
88
AssertEqual 'III', ToRoman(3)
99

10-
Execute (4, being 5 - 1, is IV):
10+
Execute (4 is IV):
1111
AssertEqual 'IV', ToRoman(4)
1212

13-
Execute (5 is a single V):
13+
Execute (5 is V):
1414
AssertEqual 'V', ToRoman(5)
1515

16-
Execute (6, being 5 + 1, is VI):
16+
Execute (6 is VI):
1717
AssertEqual 'VI', ToRoman(6)
1818

19-
Execute (9, being 10 - 1, is IX):
19+
Execute (9 is IX):
2020
AssertEqual 'IX', ToRoman(9)
2121

22-
Execute (20 is two X's):
22+
Execute (16 is XVI):
23+
AssertEqual 'XVI', ToRoman(16)
24+
25+
Execute (27 is XXVII):
2326
AssertEqual 'XXVII', ToRoman(27)
2427

25-
Execute (48 is not 50 - 2, but rather 40 + 8):
28+
Execute (48 is XLVIII):
2629
AssertEqual 'XLVIII', ToRoman(48)
2730

28-
Execute (50 is a single L):
31+
Execute (49 is XLIX):
32+
AssertEqual 'XLIX', ToRoman(49)
33+
34+
Execute (59 is LIX):
2935
AssertEqual 'LIX', ToRoman(59)
3036

31-
Execute (90, being 100 - 10, is XC):
37+
Execute (66 is LXVI):
38+
AssertEqual 'LXVI', ToRoman(66)
39+
40+
Execute (93 is XCIII):
3241
AssertEqual 'XCIII', ToRoman(93)
3342

34-
Execute (100 is a single C):
43+
Execute (141 is CXLI):
3544
AssertEqual 'CXLI', ToRoman(141)
3645

37-
Execute (60, being 50 + 10, is LX):
46+
Execute (163 is CLXIII):
3847
AssertEqual 'CLXIII', ToRoman(163)
3948

40-
Execute (400, being 500 - 100, is CD):
49+
Execute (166 is CLXVI):
50+
AssertEqual 'CLXVI', ToRoman(166)
51+
52+
Execute (402 is CDII):
4153
AssertEqual 'CDII', ToRoman(402)
4254

43-
Execute (500 is a single D):
55+
Execute (575 is DLXXV):
4456
AssertEqual 'DLXXV', ToRoman(575)
4557

46-
Execute (900, being 1000 - 100, is CM):
58+
Execute (666 is DCLXVI):
59+
AssertEqual 'DCLXVI', ToRoman(666)
60+
61+
Execute (911 is CMXI):
4762
AssertEqual 'CMXI', ToRoman(911)
4863

49-
Execute (1000 is a single M):
64+
Execute (1024 is MXXIV):
5065
AssertEqual 'MXXIV', ToRoman(1024)
5166

52-
Execute (3000 is three M's):
67+
Execute (1666 is MDCLXVI):
68+
AssertEqual 'MDCLXVI', ToRoman(1666)
69+
70+
Execute (3000 is MMM):
5371
AssertEqual 'MMM', ToRoman(3000)
72+
73+
Execute (3001 is MMMI):
74+
AssertEqual 'MMMI', ToRoman(3001)
75+
76+
Execute (3999 is MMMCMXCIX):
77+
AssertEqual 'MMMCMXCIX', ToRoman(3999)

exercises/practice/triangle/.meta/tests.toml

+7-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,13 @@ description = "scalene triangle -> no sides are equal"
5858
description = "scalene triangle -> all sides are equal"
5959

6060
[c6e15a92-90d9-4fb3-90a2-eef64f8d3e1e]
61-
description = "scalene triangle -> two sides are equal"
61+
description = "scalene triangle -> first and second sides are equal"
62+
63+
[3da23a91-a166-419a-9abf-baf4868fd985]
64+
description = "scalene triangle -> first and third sides are equal"
65+
66+
[b6a75d98-1fef-4c42-8e9a-9db854ba0a4d]
67+
description = "scalene triangle -> second and third sides are equal"
6268

6369
[70ad5154-0033-48b7-af2c-b8d739cd9fdc]
6470
description = "scalene triangle -> may not violate triangle inequality"

0 commit comments

Comments
 (0)