Skip to content

Commit a0862fe

Browse files
authored
Updating tests for matching-brackets (#2598)
1 parent 6c97691 commit a0862fe

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

exercises/practice/matching-brackets/.meta/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"contributors": [
66
"ankorGH",
77
"Futuro212",
8+
"jagdish-15",
89
"ovidiu141",
910
"rchavarria",
1011
"ryanplusplus",

exercises/practice/matching-brackets/.meta/tests.toml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

512
[81ec11da-38dd-442a-bcf9-3de7754609a5]
613
description = "paired square brackets"
@@ -41,12 +48,21 @@ description = "unpaired and nested brackets"
4148
[a0205e34-c2ac-49e6-a88a-899508d7d68e]
4249
description = "paired and wrong nested brackets"
4350

51+
[1d5c093f-fc84-41fb-8c2a-e052f9581602]
52+
description = "paired and wrong nested brackets but innermost are correct"
53+
4454
[ef47c21b-bcfd-4998-844c-7ad5daad90a8]
4555
description = "paired and incomplete brackets"
4656

4757
[a4675a40-a8be-4fc2-bc47-2a282ce6edbe]
4858
description = "too many closing brackets"
4959

60+
[a345a753-d889-4b7e-99ae-34ac85910d1a]
61+
description = "early unexpected brackets"
62+
63+
[21f81d61-1608-465a-b850-baa44c5def83]
64+
description = "early mismatched brackets"
65+
5066
[99255f93-261b-4435-a352-02bdecc9bdf2]
5167
description = "math expression"
5268

exercises/practice/matching-brackets/matching-brackets.spec.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ describe('Matching Brackets', () => {
5454
expect(isPaired('[({]})')).toEqual(false);
5555
});
5656

57+
xtest('paired and wrong nested brackets but innermost are correct', () => {
58+
expect(isPaired('[({}])')).toEqual(false);
59+
});
60+
5761
xtest('paired and incomplete brackets', () => {
5862
expect(isPaired('{}[')).toEqual(false);
5963
});
@@ -62,6 +66,14 @@ describe('Matching Brackets', () => {
6266
expect(isPaired('[]]')).toEqual(false);
6367
});
6468

69+
xtest('early unexpected brackets', () => {
70+
expect(isPaired(')()')).toEqual(false);
71+
});
72+
73+
xtest('early mismatched brackets', () => {
74+
expect(isPaired('{)()')).toEqual(false);
75+
});
76+
6577
xtest('math expression', () => {
6678
expect(isPaired('(((185 + 223.85) * 15) - 543)/2')).toEqual(true);
6779
});

0 commit comments

Comments
 (0)