Skip to content

Instantly share code, notes, and snippets.

@xiaoyunyang
Created April 25, 2018 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiaoyunyang/1a41134c5c4fe8109f2a5f1bd8ba7976 to your computer and use it in GitHub Desktop.
Save xiaoyunyang/1a41134c5c4fe8109f2a5f1bd8ba7976 to your computer and use it in GitHub Desktop.
matchParenTestCases
let testCases = [
{test: '(', shouldBe: false},
{test: '())', shouldBe: false},
{test: null, shouldBe: false},
{test: undefined, shouldBe: false},
{test: 22, shouldBe: false},
{test: ')(', shouldBe: false},
{test: '', shouldBe: true},
{test: '()', shouldBe: true},
{test: '()()', shouldBe: true},
{test: '(())', shouldBe: true},
{test: 'hi', shouldBe: true},
{test: '(hi)', shouldBe: true},
{test: '(((())(())',shouldBe: false}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment