Sha256: d6a3d3452d22a0de65994abd7857503753a21a6fa2a1ceacccc6dc30c2231c8c
Contents?: true
Size: 1.64 KB
Versions: 100
Compression:
Stored size: 1.64 KB
Contents
import org.scalatest.{Matchers, FunSuite} /** @version 1.1.0 */ class BracketPushTest extends FunSuite with Matchers { test("paired square brackets") { BracketPush.isPaired("[]") should be (true) } test("empty string") { pending BracketPush.isPaired("") should be (true) } test("unpaired brackets") { pending BracketPush.isPaired("[[") should be (false) } test("wrong ordered brackets") { pending BracketPush.isPaired("}{") should be (false) } test("wrong closing bracket") { pending BracketPush.isPaired("{]") should be (false) } test("paired with whitespace") { pending BracketPush.isPaired("{ }") should be (true) } test("simple nested brackets") { pending BracketPush.isPaired("{[]}") should be (true) } test("several paired brackets") { pending BracketPush.isPaired("{}[]") should be (true) } test("paired and nested brackets") { pending BracketPush.isPaired("([{}({}[])])") should be (true) } test("unopened closing brackets") { pending BracketPush.isPaired("{[)][]}") should be (false) } test("unpaired and nested brackets") { pending BracketPush.isPaired("([{])") should be (false) } test("paired and wrong nested brackets") { pending BracketPush.isPaired("[({]})") should be (false) } test("math expression") { pending BracketPush.isPaired("(((185 + 223.85) * 15) - 543)/2") should be (true) } test("complex latex expression") { pending BracketPush.isPaired("\\\\left(\\\\begin{array}{cc} \\\\frac{1}{3} & x\\\\\\\\ \\\\mathrm{e}^{x} &... x^2 \\\\end{array}\\\\right)") should be (true) } }
Version data entries
100 entries across 100 versions & 1 rubygems