<commit_before>'use strict'

import { color, nocolor } from '../src'
import { inspect } from 'util'
import { gray, bold, blue, magenta, yellow, green } from 'chalk'
import assert = require('power-assert')

describe('tab', () => {
  it('string: oneline x 1', () => {
    const cRes = color('%t', '\\n hello \\n')
    const nRes = nocolor('%t', '\\n hello \\n')

    const cExp = green('\\n hello \\n')
    const nExp = '\\n hello \\n'

    assert.equal(inspect(cRes), inspect(cExp))
    assert.equal(inspect(nRes), inspect(nExp))
  })

  it('string: oneline x 2', () => {
    const cRes = color('%t %t', '\r hello \v', '\\n world \\n')
    const nRes = nocolor('%t %t', '\r hello \v', '\\n world \\n')

    const cExp = green(' hello \n       ')
               + ' '
               + green('\\n world \\n')
    const nExp = ' hello \n       '
               + ' '
               + '\\n world \\n'

    assert.equal(inspect(cRes), inspect(cExp))
    assert.equal(inspect(nRes), inspect(nExp))
  })

  it('string: multiline x 1', () => {
    const cRes = color('pad %t', 'hello\nworld\v \r!')
    const nRes = nocolor('pad %t', 'hello\nworld\v \r!')

    const cExp = 'pad '
             + green('hello\n'
               + '    world\n'
               + '    !     ')
    const nExp = 'pad '
                   + 'hello\n'
               + '    world\n'
               + '    !     '

    assert.equal(inspect(cRes), inspect(cExp))
    assert.equal(inspect(nRes), inspect(nExp))
  })

  it('string: multiline pad', () => {
    const cRes = color('some\be\vstrange\r\vline\rL %t', 'what am I doing with my life?')
    const nRes = nocolor('some\be\vstrange\r\vline\rL %t', 'what am I doing with my life?')

    const cExp = 'some\be\v'
               + 'strange\r\v'
               + 'line\rL '
           + green('what am I doing with my life?')
    const nExp = 'some\be\v'
               + 'strange\r\v'
               + 'line\rL '
                 + 'what am I doing with my life?'

    assert.equal(inspect(cRes), inspect(cExp))
    assert.equal(inspect(nRes), inspect(nExp))
  })

    it('string: multiline pad & multiline replacer', () => {
    const cRes = color('some\be\vstrange\r\vline\rL %t', 'what am I doing\nwith my life?')
    const nRes = nocolor('some\be\vstrange\r\vline\rL %t', 'what am I doing\nwith my life?')

    const cExp = 'some\be\v'
               + 'strange\r\v'
               + 'line\rL '
           + green('what am I doing\n'
               + '  with my life?')
    const nExp = 'some\be\v'
               + 'strange\r\v'
               + 'line\rL '
               + 'what am I doing\n'
             + '  with my life?'

    assert.equal(inspect(cRes), inspect(cExp))
    assert.equal(inspect(nRes), inspect(nExp))
  })

})
<commit_msg>remove unnecessary imports from tabHandler.test<commit_after>'use strict'

import { color, nocolor } from '../src'
import { inspect } from 'util'
import { green } from 'chalk'
import assert = require('power-assert')

describe('tab', () => {
  it('string: oneline x 1', () => {
    const cRes = color('%t', '\\n hello \\n')
    const nRes = nocolor('%t', '\\n hello \\n')

    const cExp = green('\\n hello \\n')
    const nExp = '\\n hello \\n'

    assert.equal(inspect(cRes), inspect(cExp))
    assert.equal(inspect(nRes), inspect(nExp))
  })

  it('string: oneline x 2', () => {
    const cRes = color('%t %t', '\r hello \v', '\\n world \\n')
    const nRes = nocolor('%t %t', '\r hello \v', '\\n world \\n')

    const cExp = green(' hello \n       ')
               + ' '
               + green('\\n world \\n')
    const nExp = ' hello \n       '
               + ' '
               + '\\n world \\n'

    assert.equal(inspect(cRes), inspect(cExp))
    assert.equal(inspect(nRes), inspect(nExp))
  })

  it('string: multiline x 1', () => {
    const cRes = color('pad %t', 'hello\nworld\v \r!')
    const nRes = nocolor('pad %t', 'hello\nworld\v \r!')

    const cExp = 'pad '
             + green('hello\n'
               + '    world\n'
               + '    !     ')
    const nExp = 'pad '
                   + 'hello\n'
               + '    world\n'
               + '    !     '

    assert.equal(inspect(cRes), inspect(cExp))
    assert.equal(inspect(nRes), inspect(nExp))
  })

  it('string: multiline pad', () => {
    const cRes = color('some\be\vstrange\r\vline\rL %t', 'what am I doing with my life?')
    const nRes = nocolor('some\be\vstrange\r\vline\rL %t', 'what am I doing with my life?')

    const cExp = 'some\be\v'
               + 'strange\r\v'
               + 'line\rL '
           + green('what am I doing with my life?')
    const nExp = 'some\be\v'
               + 'strange\r\v'
               + 'line\rL '
                 + 'what am I doing with my life?'

    assert.equal(inspect(cRes), inspect(cExp))
    assert.equal(inspect(nRes), inspect(nExp))
  })

    it('string: multiline pad & multiline replacer', () => {
    const cRes = color('some\be\vstrange\r\vline\rL %t', 'what am I doing\nwith my life?')
    const nRes = nocolor('some\be\vstrange\r\vline\rL %t', 'what am I doing\nwith my life?')

    const cExp = 'some\be\v'
               + 'strange\r\v'
               + 'line\rL '
           + green('what am I doing\n'
               + '  with my life?')
    const nExp = 'some\be\v'
               + 'strange\r\v'
               + 'line\rL '
               + 'what am I doing\n'
             + '  with my life?'

    assert.equal(inspect(cRes), inspect(cExp))
    assert.equal(inspect(nRes), inspect(nExp))
  })

})

{'fraction_non_alphanumeric': 0.18007593563550894, 'fraction_numerical': 0.0010847947929849937, 'mean_word_length': 1.8066971080669711, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '7213784', 'n_tokens_mistral': 2019, 'n_tokens_neox': 1956, 'n_words': 465}