<commit_before>require 'test_helper'

class TTest < Minitest::Test
  def test_parse_literals
    assert_equal ["lit", 1], minruby_parse("1")
    assert_equal ["lit", "foo"], minruby_parse("\"foo\"")
    assert_equal ["lit", nil], minruby_parse("nil")
    assert_equal ["lit", true], minruby_parse("true")
    assert_equal ["lit", false], minruby_parse("false")
  end

  def test_parse_binary
    assert_equal ["+" , ["lit", 1], ["lit", 2]], minruby_parse("1 + 2")
    assert_equal ["-" , ["lit", 1], ["lit", 2]], minruby_parse("1 - 2")
    assert_equal ["*" , ["lit", 1], ["lit", 2]], minruby_parse("1 * 2")
    assert_equal ["/" , ["lit", 1], ["lit", 2]], minruby_parse("1 / 2")
    assert_equal ["%" , ["lit", 1], ["lit", 2]], minruby_parse("1 % 2")
    assert_equal ["<" , ["lit", 1], ["lit", 2]], minruby_parse("1 < 2")
    assert_equal ["<=", ["lit", 1], ["lit", 2]], minruby_parse("1 <= 2")
    assert_equal ["==", ["lit", 1], ["lit", 2]], minruby_parse("1 == 2")
    assert_equal [">=", ["lit", 1], ["lit", 2]], minruby_parse("1 >= 2")
    assert_equal [">" , ["lit", 1], ["lit", 2]], minruby_parse("1 > 2")
  end

  def test_parse_stmts<commit_msg>負のリテラルのテスト追加<commit_after>require 'test_helper'

class TTest < Minitest::Test
  def test_parse_literals
    assert_equal ["lit", 1], minruby_parse("1")
    assert_equal ["lit", -1], minruby_parse("-1")
    assert_equal ["lit", "foo"], minruby_parse("\"foo\"")
    assert_equal ["lit", nil], minruby_parse("nil")
    assert_equal ["lit", true], minruby_parse("true")
    assert_equal ["lit", false], minruby_parse("false")
  end

  def test_parse_binary
    assert_equal ["+" , ["lit", 1], ["lit", 2]], minruby_parse("1 + 2")
    assert_equal ["-" , ["lit", 1], ["lit", 2]], minruby_parse("1 - 2")
    assert_equal ["*" , ["lit", 1], ["lit", 2]], minruby_parse("1 * 2")
    assert_equal ["/" , ["lit", 1], ["lit", 2]], minruby_parse("1 / 2")
    assert_equal ["%" , ["lit", 1], ["lit", 2]], minruby_parse("1 % 2")
    assert_equal ["<" , ["lit", 1], ["lit", 2]], minruby_parse("1 < 2")
    assert_equal ["<=", ["lit", 1], ["lit", 2]], minruby_parse("1 <= 2")
    assert_equal ["==", ["lit", 1], ["lit", 2]], minruby_parse("1 == 2")
    assert_equal [">=", ["lit", 1], ["lit", 2]], minruby_parse("1 >= 2")
    assert_equal [">" , ["lit", 1], ["lit", 2]], minruby_parse("1 > 2")
  end

  def test_parse_stmts
{'fraction_non_alphanumeric': 0.25921219822109276, 'fraction_numerical': 0.03642524354087251, 'mean_word_length': 4.505827505827506, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '3584663', 'n_tokens_mistral': 971, 'n_tokens_neox': 869, 'n_words': 209}