<commit_before>package edu.oregonstate.mutation.statementHistory

class FileFinderTest extends GitTest {
  
  var fileFinder: FileFinder = _
  
  override def beforeEach = {
    super.beforeEach
    fileFinder = new FileFinder(repo.getAbsolutePath)
  }
  
  it should "find the file" in {
    val commit = add("A.java", "public class A{}")
    val sha = fileFinder.findFirst("A.java", "HEAD").getName
    commit.getName should equal (sha)
  }
  
  it should "find the file in more than one commit" in {
     add("B.java", "public class B{]")
     val commit = add("A.java", "public class A{}")
     val sha = fileFinder.findFirst("A.java", "HEAD").getName
     commit.getName should equal (sha)
  }

  it should "find both occurances" in {
    val first = add("A.java", "public class A{}")
    val second = add("A.java", "public class A{public void m(){}}")
    val expectedList = Seq(first getName, second getName)
    val all = fileFinder.findAll("A.java", "HEAD")
    all should have size 2
    all should equal (expectedList)
  }
  
  it should "find both occurances in more than two commits" in {
    val first = add("A.java", "public class A{}")
 		add("B.java", "public class B{}")
    val second = add("A.java", "public class B{}")
    val expectedList = Seq(first getName, second getName)
    val all = fileFinder.findAll("A.java", "HEAD")
    all should have size 2
    all should equal (expectedList)
  }

  it should "find file from incomplete path" in {
    var first = add("src/bla/A.java", "public class A{}")
    val all = fileFinder.findAll("A.java", "HEAD")
    all should have size 1
    all(0) should equal (first getName)
  }
}<commit_msg>Added sanity test<commit_after>package edu.oregonstate.mutation.statementHistory

class FileFinderTest extends GitTest {
  
  var fileFinder: FileFinder = _
  
  override def beforeEach = {
    super.beforeEach
    fileFinder = new FileFinder(repo.getAbsolutePath)
  }
  
  it should "find the file" in {
    val commit = add("A.java", "public class A{}")
    val sha = fileFinder.findFirst("A.java", "HEAD").getName
    commit.getName should equal (sha)
  }
  
  it should "find the file in more than one commit" in {
     add("B.java", "public class B{]")
     val commit = add("A.java", "public class A{}")
     val sha = fileFinder.findFirst("A.java", "HEAD").getName
     commit.getName should equal (sha)
  }

  it should "find both occurances" in {
    val first = add("A.java", "public class A{}")
    val second = add("A.java", "public class A{public void m(){}}")
    val expectedList = Seq(first getName, second getName)
    val all = fileFinder.findAll("A.java", "HEAD")
    all should have size 2
    all should equal (expectedList)
  }
  
  it should "find both occurances in more than two commits" in {
    val first = add("A.java", "public class A{}")
 		add("B.java", "public class B{}")
    val second = add("A.java", "public class B{}")
    val expectedList = Seq(first getName, second getName)
    val all = fileFinder.findAll("A.java", "HEAD")
    all should have size 2
    all should equal (expectedList)
  }

  it should "find file from incomplete path" in {
    var first = add("src/bla/A.java", "public class A{}")
    val all = fileFinder.findAll("A.java", "HEAD")
    all should have size 1
    all(0) should equal (first getName)
  }

  it should "find the file three times" in {
    var first = add("A.java", "public class A{}");
    val second = add("A.java", "public class A2{}");
    var third = add("A.java", "public class A3{}");
    val expected = Seq(first.getName, second.getName, third.getName)
    val all = fileFinder.findAll("A.java", "HEAD")
    all should have size expected.size
    all should equal (expected)
  }
}
{'fraction_non_alphanumeric': 0.1319537758667025, 'fraction_numerical': 0.0026874496103198066, 'mean_word_length': 3.2488584474885847, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4156823', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1196, 'n_words': 402}