<commit_before>require "test/unit"
require 'ghtorrent'

class CallStackTest < Test::Unit::TestCase

  def setup
  end

  def teardown
  end

  def test_constructor
    assert_raise Exception do
      CallStack.new('users', 0)
      CallStack.new('users', 0)
    end
  end

  def test_push
    stack = CallStack.new('users1', 0)
    assert_not_nil stack

    stack.push("foo bar")
    stack.push("2")
    stack.push("1234421")
    stack.empty
  end

  def test_pop
    stack = CallStack.new('users2', 0)
    assert_not_nil stack

    stack.push("foo bar")
    stack.push("2")
    stack.push("1234421")

    assert stack.pop == "1234421"
    stack.empty
  end

  def test_push_pop_push
    stack = CallStack.new('users3', 0)
    assert_not_nil stack

    stack.push("foo bar")
    stack.push("2")

    stack.pop

    stack.push("1234421")

<<<<<<< HEAD
=======
    stack

>>>>>>> 9a7702f0286a4e012d184b90273f4efd9ead2633
    stack.empty
  end

  def test_stress
    stack = CallStack.new('users4', 0)
<<<<<<< HEAD

    1000.times do
      txt = (0..rand(20)).map{65.+(rand(25)).chr}.join
      stack.push txt
    end

    999.times do
=======
    1..1000.times do
      txt = (0...rand(20)).map{65.+(rand(25)).chr}.join
      stack.push txt
    end

    1..999.times do
>>>>>>> 9a7702f0286a4e012d184b90273f4efd9ead2633
      stack.pop
    end
    stack.pop
  end
end<commit_msg>Fix weird merge conflict (?)<commit_after>require "test/unit"
require 'ghtorrent'

class CallStackTest < Test::Unit::TestCase

  def setup
  end

  def teardown
  end

  def test_constructor
    assert_raise Exception do
      CallStack.new('users', 0)
      CallStack.new('users', 0)
    end
  end

  def test_push
    stack = CallStack.new('users1', 0)
    assert_not_nil stack

    stack.push("foo bar")
    stack.push("2")
    stack.push("1234421")
    stack.empty
  end

  def test_pop
    stack = CallStack.new('users2', 0)
    assert_not_nil stack

    stack.push("foo bar")
    stack.push("2")
    stack.push("1234421")

    assert stack.pop == "1234421"
    stack.empty
  end

  def test_push_pop_push
    stack = CallStack.new('users3', 0)
    assert_not_nil stack

    stack.push("foo bar")
    stack.push("2")

    stack.pop

    stack.push("1234421")

    stack.empty
  end

  def test_stress
    stack = CallStack.new('users4', 0)

    1000.times do
      txt = (0..rand(20)).map{65.+(rand(25)).chr}.join
      stack.push txt
    end

    999.times do
      stack.pop
    end
    stack.pop
  end
end
{'fraction_non_alphanumeric': 0.1329851345922057, 'fraction_numerical': 0.07231820008035356, 'mean_word_length': 2.598265895953757, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6164193', 'n_tokens_mistral': 1027, 'n_tokens_neox': 894, 'n_words': 189}