Sha256: ad31e8fed2c52fa017fd81d06f8d7af36123a38faa73a23e9c5cd6c0d00bcfb8

Contents?: true

Size: 1.62 KB

Versions: 72

Compression:

Stored size: 1.62 KB

Contents

import org.scalatest.{Matchers, FunSuite}

/** @version 1.2.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

72 entries across 72 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.179 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.178 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.177 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.176 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.175 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.174 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.173 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.172 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.171 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.170 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.169 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.167 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.166 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.165 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.164 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.163 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.162 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.161 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala
trackler-2.2.1.160 tracks/scala/exercises/bracket-push/src/test/scala/BracketPushTest.scala