<commit_before>const tape = require('tape')
const wrappedMethods = require('./methods')

var tapeMock = (arg0, arg1, cb) => {
  cb = cb || arg1 || arg0 // `arg0` and `arg1` are optional in `tape`
  cb(testObjectMock)
  return [arg0, arg1, cb]
}
var testObjectMock = { end: function () {} }
wrappedMethods.forEach(elem => {
  testObjectMock[elem] = function () { return arguments }
})
global.flipTape = { tapeMock }
const flippedTape = require('.')

var arityToMethod = {
  1: ['fail', 'pass', 'skip'],
  2: ['ok', 'notOk', 'error'],
  3: ['equal', 'notEqual', 'deepEqual', 'notDeepEqual', 'deepLooseEqual', 'notDeepLooseEqual', 'throws', 'doesNotThrow', 'comment']
}

flippedTape(x => {
  tape('`String.prototype.test(cb)`', t => {
    t.plan(2)
    let cbArgument = null
    let cbMock = t => { cbArgument = t }

    let testOpts = {}
    let result = 'msg'.test(testOpts, cbMock)
    result[0] = result[0].toString()
    t.deepEqual(result, tapeMock('msg', testOpts, cbMock), '`tape` is attached to `String.prototype` as `test`')

    'msg'.test(cbMock)
    t.deepEqual(cbArgument, testObjectMock, 'test object is passed on to cb')
  })

  tape('`String.prototype.t(cb)`', t => {
    t.plan(1)

    let cbArgument = null
    let cbMock = t => { cbArgument = t }
    'msg'.t(cbMock)
    t.deepEqual(cbArgument, testObjectMock, 'test object is passed on to cb')
  })

  Object.keys(arityToMethod).forEach(arity => {
    arity = +arity
    arityToMethod[arity].forEach(method => {
      let args = callMethod(method, arity)

      tape('`String.prototype.' + method + '()`', t => {
        if (arity === 3) {<commit_msg>check equality of results not of functions<commit_after>const tape = require('tape')
const wrappedMethods = require('./methods')

var tapeMock = (arg0, arg1, cb) => {
  cb = cb || arg1 || arg0 // `arg0` and `arg1` are optional in `tape`
  let res = cb(testObjectMock)
  return [arg0, arg1, res]
}
var testObjectMock = { end: function () {} }
wrappedMethods.forEach(elem => {
  testObjectMock[elem] = function () { return arguments }
})
global.flipTape = { tapeMock }
const flippedTape = require('.')

var arityToMethod = {
  1: ['fail', 'pass', 'skip'],
  2: ['ok', 'notOk', 'error'],
  3: ['equal', 'notEqual', 'deepEqual', 'notDeepEqual', 'deepLooseEqual', 'notDeepLooseEqual', 'throws', 'doesNotThrow', 'comment']
}

flippedTape(x => {
  tape('`String.prototype.test(cb)`', t => {
    t.plan(2)
    let cbArgument = null
    let cbMock = t => { cbArgument = t }

    let testOpts = {test: 123}
    let result = 'msg'.test(testOpts, cbMock)
    result[0] = result[0].toString()
    t.deepEqual(result, tapeMock('msg', testOpts, cbMock), '`tape` is attached to `String.prototype` as `test`')

    'msg'.test(cbMock)
    t.deepEqual(cbArgument, testObjectMock, 'test object is passed on to cb')
  })

  tape('`String.prototype.t(cb)`', t => {
    t.plan(1)

    let cbArgument = null
    let cbMock = t => { cbArgument = t }
    'msg'.t(cbMock)
    t.deepEqual(cbArgument, testObjectMock, 'test object is passed on to cb')
  })

  Object.keys(arityToMethod).forEach(arity => {
    arity = +arity
    arityToMethod[arity].forEach(method => {
      let args = callMethod(method, arity)

      tape('`String.prototype.' + method + '()`', t => {
        if (arity === 3) {
{'fraction_non_alphanumeric': 0.17766960754487374, 'fraction_numerical': 0.01064800730149072, 'mean_word_length': 3.690442225392297, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '577147', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1145, 'n_words': 284}