Sha256: 7ef23a9089fb514d186834d096c4d4a446412696c9db8f1aa4900508fa5b994f
Contents?: true
Size: 922 Bytes
Versions: 76
Compression:
Stored size: 922 Bytes
Contents
import ceylon.test { ... } {[String, Boolean]*} cases => { // paired square brackets ["[]", true], // empty string ["", true], // unpaired brackets ["[[", false], // wrong ordered brackets ["}{", false], // paired with whitespace ["{ }", true], // simple nested brackets ["{[]}", true], // several paired brackets ["{}[]", true], // paired and nested brackets ["([{}({}[])])", true], // unopened closing brackets ["{[)][]}", false], // unpaired and nested brackets ["([{])", false], // paired and wrong nested brackets ["[({]})", false], // math expression ["(((185 + 223.85) * 15) - 543)/2", true], // complex latex expression ["\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)", true] }; test parameters(`value cases`) void testBalanced(String brackets, Boolean expected) { assertEquals(balanced(brackets), expected); }
Version data entries
76 entries across 76 versions & 1 rubygems