<commit_before>const chalk = require('chalk')
const testOps = require('../testOps')
const fs = require('fs-extra')

module.exports = flags => {
  const name = 'state'
  testOps.setupTest(flags, name)

  testOps.newline()
  console.info(chalk.inverse('ADD FILES'))

  const files = ['hello.txt', 'fox.sh', 'binary.bin']

  fs.outputFileSync(files[0], 'hello world\nfoo bar')
  fs.outputFileSync(files[1], 'echo "the quick brown fox jumped over the lazy dog"')
  fs.outputFileSync(files[2], ']W^��Jɩ���������+^2��)\u001c�V�^pvӳ��4���K>�\u000e�C�����\nL�\b�AC��5-~�$\u0005z��\r�̾ob��mjكB�������+�T�C\u001bh\u0004�u/���v�0�\u001e�\f�ܳ�5rV||X��[��J��^��ƞH�&Ki\r4�\u0019�')

  console.info(chalk.inverse('MU DIFF, MU SAVE'))
  testOps.testMu(['diff','.'])
  testOps.muSave()

  /* without a timeout the files change so quickly that their modified time stamps
    are identical. If the time stamp is the same and the size doesn't change then
    mu can't tell that it has been edited. */
  setTimeout(() => {
    fs.outputFileSync(files[0], 'Hello the world bar foo')
    fs.outputFileSync(files[1], 'echo "the Quick fox jumped high over\nthe lazy dog."')
    fs.outputFileSync(files[2], ']W^��Jɩ������+^2��)\u001c�V�^pvӳ��4u000e�C�����\nL�\b�AC��005z��\r�̾ob��mj����+�T�C\u001bh\u0004�u/���v�0�\u001e�\f�ܳ�5rV||X��[�^��ƞH�&Ki\r4�\u0019�')

    testOps.newline()

    console.info(chalk.inverse('MU DIFF'))
    testOps.testMu(['diff','.'])

    fs.removeSync(files[0])
    fs.removeSync(files[1])
    fs.removeSync(files[2])

    console.info(chalk.inverse('MU DIFF'))
    testOps.testMu(['diff','.'])

    testOps.cleanupTest(flags, name)

  }, 1000)

}<commit_msg>improves diff comments<commit_after>const chalk = require('chalk')
const testOps = require('../testOps')
const fs = require('fs-extra')

module.exports = flags => {
  const name = 'state'
  testOps.setupTest(flags, name)

  testOps.newline()
  console.info(chalk.inverse('ADD FILES'))

  const files = ['hello.txt', 'fox.sh', 'binary.bin']

  fs.outputFileSync(files[0], 'hello world\nfoo bar')
  fs.outputFileSync(files[1], 'echo "the quick brown fox jumped over the lazy dog"')
  fs.outputFileSync(files[2], ']W^��Jɩ���������+^2��)\u001c�V�^pvӳ��4���K>�\u000e�C�����\nL�\b�AC��5-~�$\u0005z��\r�̾ob��mjكB�������+�T�C\u001bh\u0004�u/���v�0�\u001e�\f�ܳ�5rV||X��[��J��^��ƞH�&Ki\r4�\u0019�')

  console.info(chalk.inverse('MU DIFF'))
  testOps.testMu(['diff','.'])
  console.info(chalk.inverse('MU SAVE'))
  testOps.muSave()

  /* without a timeout the files change so quickly that their modified time stamps
    are identical. If the time stamp is the same and the size doesn't change then
    mu can't tell that it has been edited. */
  setTimeout(() => {
    fs.outputFileSync(files[0], 'Hello the world bar foo')
    fs.outputFileSync(files[1], 'echo "the Quick fox jumped high over\nthe lazy dog."')
    fs.outputFileSync(files[2], ']W^��Jɩ������+^2��)\u001c�V�^pvӳ��4u000e�C�����\nL�\b�AC��005z��\r�̾ob��mj����+�T�C\u001bh\u0004�u/���v�0�\u001e�\f�ܳ�5rV||X��[�^��ƞH�&Ki\r4�\u0019�')

    testOps.newline()

    console.info(chalk.inverse('MU DIFF'))
    testOps.testMu(['diff','.'])

    console.info(chalk.inverse('DEL FILES'))

    fs.removeSync(files[0])
    fs.removeSync(files[1])
    fs.removeSync(files[2])

    console.info(chalk.inverse('MU DIFF'))
    testOps.testMu(['diff','.'])

    testOps.cleanupTest(flags, name)

  }, 1000)

}
{'fraction_non_alphanumeric': 0.2333431171118286, 'fraction_numerical': 0.04167889638978574, 'mean_word_length': 4.661129568106312, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3904448', 'n_tokens_mistral': 1611, 'n_tokens_neox': 1397, 'n_words': 234}