<commit_before>package collection

import org.scalatest.FunSuite

class ImmutableTest extends FunSuite {
  test("set") {
    val set = Set(1, 2)
    assert(set == Set(1) ++ Set(2))
    assert(set == Set(1) + 2)
    assert(set == Set(1, 2, 3) - 3)
    assert(set.contains(1))
  }

  test("map") {
    val map = Map(1 -> 1, 2 -> 2)
    assert(map == Map(1 -> 1) ++ Map(2 -> 2))
    assert(map == Map(1 -> 1) + (2 -> 2))
    assert(map == Map(1 -> 1, 2 -> 2, 3 -> 3) - 3)
    assert(map.get(1).get == 1)
  }

  test("seq") {
    val seq = Seq(1, 2)
    assert(seq == 1 :: 2 :: Nil)
    assert(seq == 1 +: Seq(2))
    assert(seq == Seq(1) :+ 2)
    assert(seq == Seq(1) ++ Seq(2))
    assert(seq == Seq(1) ++: Seq(2))
  }

  test("list") {
    val list = List(1, 2)
    assert(list == List(1) ::: List(2))
    assert(list == 1 :: List(2))
    assert(list == 1 :: 2 :: Nil)
    assert(list == List(1) ::: List(2))
    assert(list == 1 :: List(2))
    assert(list == 1 +: List(2))
    assert(list == List(1) :+ 2)
    assert(list == List(1) ++ List(2))
    assert(list == List(1) ++: List(2))
  }

  test("vector") {
    val vector = Vector(1, 2, 3)
    assert(vector == 1 +: Vector(2, 3))
    assert(vector == Vector(1, 2) :+ 3)
    assert(vector == Vector(1) ++ Vector(2, 3))
    assert(vector == Vector(1) ++: Vector(2, 3))
  }

  test("stream") {
    val numberOfEvens = (1 to 100).toStream.count(_ % 2 == 0)
    assert(numberOfEvens == 50)
  }

  test("tuple") {
    val (first, last) = ("john", "doe")
    assert(first == "john" && last == "doe")

    val (city, state) = "Tampa" -> "Florida"
    assert(city == "Tampa" && state == "Florida")
  }

  test("view") {
    val result = (1 to 10000000).view.map(_ % 10).filter(_ > 5).sum
    assert(result == 30000000)
  }

  test("view less") {
    val result = (1 to 10000000).map(_ % 10).filter(_ > 5).sum
    assert(result == 30000000)
  }

  test("iterator") {
    val result = (1 to 10000000).iterator.map(_ % 10).filter(_ > 5).sum
    assert(result == 30000000)
  }
}<commit_msg>refactored tuple test<commit_after>package collection

import org.scalatest.FunSuite

class ImmutableTest extends FunSuite {
  test("set") {
    val set = Set(1, 2)
    assert(set == Set(1) ++ Set(2))
    assert(set == Set(1) + 2)
    assert(set == Set(1, 2, 3) - 3)
    assert(set.contains(1))
  }

  test("map") {
    val map = Map(1 -> 1, 2 -> 2)
    assert(map == Map(1 -> 1) ++ Map(2 -> 2))
    assert(map == Map(1 -> 1) + (2 -> 2))
    assert(map == Map(1 -> 1, 2 -> 2, 3 -> 3) - 3)
    assert(map.get(1).get == 1)
  }

  test("seq") {
    val seq = Seq(1, 2)
    assert(seq == 1 :: 2 :: Nil)
    assert(seq == 1 +: Seq(2))
    assert(seq == Seq(1) :+ 2)
    assert(seq == Seq(1) ++ Seq(2))
    assert(seq == Seq(1) ++: Seq(2))
  }

  test("list") {
    val list = List(1, 2)
    assert(list == List(1) ::: List(2))
    assert(list == 1 :: List(2))
    assert(list == 1 :: 2 :: Nil)
    assert(list == List(1) ::: List(2))
    assert(list == 1 :: List(2))
    assert(list == 1 +: List(2))
    assert(list == List(1) :+ 2)
    assert(list == List(1) ++ List(2))
    assert(list == List(1) ++: List(2))
  }

  test("vector") {
    val vector = Vector(1, 2, 3)
    assert(vector == 1 +: Vector(2, 3))
    assert(vector == Vector(1, 2) :+ 3)
    assert(vector == Vector(1) ++ Vector(2, 3))
    assert(vector == Vector(1) ++: Vector(2, 3))
  }

  test("stream") {
    val numberOfEvens = (1 to 100).toStream.count(_ % 2 == 0)
    assert(numberOfEvens == 50)
  }

  test("tuple") {
    val (first, last) = ("fred", "flintstone")
    assert(first == "fred" && last == "flintstone")
    val (city, state) = "barney" -> "rebel"
    assert(city == "barney" && state == "rebel")
  }

  test("view") {
    val result = (1 to 10000000).view.map(_ % 10).filter(_ > 5).sum
    assert(result == 30000000)
  }

  test("view less") {
    val result = (1 to 10000000).map(_ % 10).filter(_ > 5).sum
    assert(result == 30000000)
  }

  test("iterator") {
    val result = (1 to 10000000).iterator.map(_ % 10).filter(_ > 5).sum
    assert(result == 30000000)
  }
}
{'fraction_non_alphanumeric': 0.2210242587601078, 'fraction_numerical': 0.07204116638078903, 'mean_word_length': 2.684115523465704, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 12, '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': '3098153', 'n_tokens_mistral': 1810, 'n_tokens_neox': 1585, 'n_words': 378}