Sha256: da37a78661d89598c4d29d8ae24c603fc3d3a06aa6031a945576290426a3a416

Contents?: true

Size: 1.78 KB

Versions: 69

Compression:

Stored size: 1.78 KB

Contents

if !System.get_env("EXERCISM_TEST_EXAMPLES") do
  Code.load_file("bracket_push.exs", __DIR__)
end

ExUnit.start()
ExUnit.configure(exclude: :pending, trace: true)

defmodule BracketPushTest do
  use ExUnit.Case

  # @tag :pending
  test "paired square brackets" do
    assert BracketPush.check_brackets("[]")
  end

  @tag :pending
  test "empty string" do
    assert BracketPush.check_brackets("")
  end

  @tag :pending
  test "unpaired brackets" do
    refute BracketPush.check_brackets("[[")
  end

  @tag :pending
  test "wrong ordered brackets" do
    refute BracketPush.check_brackets("}{")
  end

  @tag :pending
  test "wrong closing bracket" do
    refute BracketPush.check_brackets("{]")
  end

  @tag :pending
  test "paired with whitespace" do
    assert BracketPush.check_brackets("{ }")
  end

  @tag :pending
  test "simple nested brackets" do
    assert BracketPush.check_brackets("{[]}")
  end

  @tag :pending
  test "several paired brackets" do
    assert BracketPush.check_brackets("{}[]")
  end

  @tag :pending
  test "paired and nested brackets" do
    assert BracketPush.check_brackets("([{}({}[])])")
  end

  @tag :pending
  test "unopened closing brackets" do
    refute BracketPush.check_brackets("{[)][]}")
  end

  @tag :pending
  test "unpaired and nested brackets" do
    refute BracketPush.check_brackets("([{])")
  end

  @tag :pending
  test "paired and wrong nested brackets" do
    refute BracketPush.check_brackets("[({]})")
  end

  @tag :pending
  test "math expression" do
    assert BracketPush.check_brackets("(((185 + 223.85) * 15) - 543)/2")
  end

  @tag :pending
  test "complex latex expression" do
    assert BracketPush.check_brackets(
             "\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)"
           )
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

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