<commit_before>package io.citrine.lolo.util
import org.junit.Test

class LoloPyDataLoaderTest {

  private def getData: Array[Byte] = {
    val stream = getClass.getClassLoader.getResourceAsStream("4by4double.bytes")
    val byteArray = new Array[Byte](128)
    stream.read(byteArray)
    byteArray
  }

  @Test
  def testFeatureArray() = {
    val data = LoloPyDataLoader.getFeatureArray(getData, 4, false)
    assert(data.length == 4)
    assert(data.head.length == 4)
    assert(Math.abs(data.head(1) - 1) < 1e-6, "Array read in wrong order")
  }

  @Test
  def test1DArrayDouble() = {
    val temp = getData
    val data = LoloPyDataLoader.get1DArray(getData, true, false).asInstanceOf[Seq[Double]]
    assert(data.length == 16)
    assert(Math.abs(data(1) - 1) < 1e-6, "Array read badly")
  }

  @Test
  def test1DArrayInteger() = {
    val data = LoloPyDataLoader.get1DArray(getData, false, false).asInstanceOf[Seq[Int]]
    assert(data.length == 32)<commit_msg>Test fix: Functions must have a return type<commit_after>package io.citrine.lolo.util
import org.junit.Test

class LoloPyDataLoaderTest {

  private def getData: Array[Byte] = {
    val stream = getClass.getClassLoader.getResourceAsStream("4by4double.bytes")
    val byteArray = new Array[Byte](128)
    stream.read(byteArray)
    byteArray
  }

  @Test
  def testFeatureArray(): Unit = {
    val data = LoloPyDataLoader.getFeatureArray(getData, 4, false)
    assert(data.length == 4)
    assert(data.head.length == 4)
    assert(Math.abs(data.head(1) - 1) < 1e-6, "Array read in wrong order")
  }

  @Test
  def test1DArrayDouble(): Unit = {
    val temp = getData
    val data = LoloPyDataLoader.get1DArray(getData, true, false).asInstanceOf[Seq[Double]]
    assert(data.length == 16)
    assert(Math.abs(data(1) - 1) < 1e-6, "Array read badly")
  }

  @Test
  def test1DArrayInteger(): Unit = {
    val data = LoloPyDataLoader.get1DArray(getData, false, false).asInstanceOf[Seq[Int]]
    assert(data.length == 32)
{'fraction_non_alphanumeric': 0.1280241935483871, 'fraction_numerical': 0.024193548387096774, 'mean_word_length': 3.829683698296837, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '4043294', 'n_tokens_mistral': 719, 'n_tokens_neox': 688, 'n_words': 145}