-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bracket-push: rename to matching-brackets (#253)
This rename was proposed in: exercism/problem-specifications#1501 The rationale for the name is: * to name the exercise by its story, not by what it potentially teaches * to avoid unnecessarily biasing the solution space
- Loading branch information
1 parent
ee9d4fd
commit 62d2ea2
Showing
10 changed files
with
77 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
exercises/bracket-push/README.md → exercises/matching-brackets/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import MatchingBrackets from './matching-brackets' | ||
|
||
describe('Matching Brackets', () => { | ||
it('paired square brackets', () => { | ||
const matchingBrackets = new MatchingBrackets('[]') | ||
expect(matchingBrackets.isPaired()).toBeTruthy() | ||
}) | ||
|
||
xit('empty string', () => { | ||
const matchingBrackets = new MatchingBrackets('') | ||
expect(matchingBrackets.isPaired()).toBeTruthy() | ||
}) | ||
|
||
xit('unpaired brackets', () => { | ||
const matchingBrackets = new MatchingBrackets('[[') | ||
expect(matchingBrackets.isPaired()).toBeFalsy() | ||
}) | ||
|
||
xit('wrong ordered brackets', () => { | ||
const matchingBrackets = new MatchingBrackets('}{') | ||
expect(matchingBrackets.isPaired()).toBeFalsy() | ||
}) | ||
|
||
xit('wrong closing bracket', () => { | ||
const matchingBrackets = new MatchingBrackets('{]') | ||
expect(matchingBrackets.isPaired()).toBeFalsy() | ||
}) | ||
|
||
xit('paired with whitespace', () => { | ||
const matchingBrackets = new MatchingBrackets('{ }') | ||
expect(matchingBrackets.isPaired()).toBeTruthy() | ||
}) | ||
|
||
xit('simple nested brackets', () => { | ||
const matchingBrackets = new MatchingBrackets('{[]}') | ||
expect(matchingBrackets.isPaired()).toBeTruthy() | ||
}) | ||
|
||
xit('several paired brackets', () => { | ||
const matchingBrackets = new MatchingBrackets('{}[]') | ||
expect(matchingBrackets.isPaired()).toBeTruthy() | ||
}) | ||
|
||
xit('paired and nested brackets', () => { | ||
const matchingBrackets = new MatchingBrackets('([{}({}[])])') | ||
expect(matchingBrackets.isPaired()).toBeTruthy() | ||
}) | ||
|
||
xit('unopened closing brackets', () => { | ||
const matchingBrackets = new MatchingBrackets('{[)][]}') | ||
expect(matchingBrackets.isPaired()).toBeFalsy() | ||
}) | ||
|
||
xit('unpaired and nested brackets', () => { | ||
const matchingBrackets = new MatchingBrackets('([{])') | ||
expect(matchingBrackets.isPaired()).toBeFalsy() | ||
}) | ||
|
||
xit('paired and wrong nested brackets', () => { | ||
const matchingBrackets = new MatchingBrackets('[({]})') | ||
expect(matchingBrackets.isPaired()).toBeFalsy() | ||
}) | ||
|
||
xit('math expression', () => { | ||
const matchingBrackets = new MatchingBrackets('(((185 + 223.85) * 15) - 543)/2') | ||
expect(matchingBrackets.isPaired()).toBeTruthy() | ||
}) | ||
|
||
xit('complex latex expression', () => { | ||
const matchingBrackets = new MatchingBrackets('\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)') | ||
expect(matchingBrackets.isPaired()).toBeTruthy() | ||
}) | ||
}) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.