<commit_before>import unittest

from gitsqueeze import diff

class HgDiffTest(unittest.TestCase):

   def test_can_parse_diff(self):
      diffdata = [
         'A file1',
         'A file2',
         'R file3',
         'A file4',
         '  file5',
         'R file5',
         'A file6',
         '  file7',
         'C file8'
      ]

      d = diff.HgDiff("")
      result = d._parse_diff(diffdata)

      self.assertEquals(result, {
         'ADDED': [["file1"], ["file2"], ["file8"]],
         'DELETED': [["file3"]],
         'MODIFIED': [],
         'COPIED': [['file7', 'file6']],
         'RENAMED': [['file5', 'file4']]
      })

   def test_can_parse_empty_diff(self):
      diffdata = []
      d = diff.HgDiff("")
      result = d._parse_diff(diffdata)
      self.assertEquals({
         'ADDED': [],
         'DELETED': [],<commit_msg>Add modification to HgDiff test<commit_after>import unittest

from gitsqueeze import diff

class HgDiffTest(unittest.TestCase):

   def test_can_parse_diff(self):
      diffdata = [
         'A file1', # add file1 and file2
         'A file2',
         'R file3', # remove file3
         'A file4', # rename file5 -> file4
         '  file5',
         'R file5',
         'A file6', # copy file7 to file6
         '  file7',
         'C file8',  # add file8
         'M file9'   # modify file9
      ]

      d = diff.HgDiff("")
      result = d._parse_diff(diffdata)

      self.assertEquals(result, {
         'ADDED': [["file1"], ["file2"], ["file8"]],
         'DELETED': [["file3"]],
         'MODIFIED': [["file9"]],
         'COPIED': [['file7', 'file6']],
         'RENAMED': [['file5', 'file4']]
      })

   def test_can_parse_empty_diff(self):
      diffdata = []
      d = diff.HgDiff("")
      result = d._parse_diff(diffdata)
      self.assertEquals({
         'ADDED': [],
         'DELETED': [],
{'fraction_non_alphanumeric': 0.16595059076262084, 'fraction_numerical': 0.024167561761546726, 'mean_word_length': 1.9384858044164037, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5129206', 'n_tokens_mistral': 653, 'n_tokens_neox': 634, 'n_words': 134}