<commit_before>var tape             = require('tape')
  , EE               = require('events').EventEmitter
  , util             = require('util')


  , isStream         = require('./')
  , isReadable       = require('./').isReadable
  , isWritable       = require('./').isWritable
  , isDuplex         = require('./').isDuplex

  , CoreStreams      = require('stream')
  , ReadableStream10 = require('./readable-stream-1.0/')
  , ReadableStream11 = require('./readable-stream-1.1/')


function test (pass, type, stream) {
  tape('isStream('  + type + ')', function (t) {
    t.plan(1)
    t.ok(pass === isStream(stream), type)
  })
}


function testReadable (pass, type, stream) {
  tape('isReadable('  + type + ')', function (t) {
    t.plan(1)
    t.ok(pass === isReadable(stream), type)
  })
}


function testWritable (pass, type, stream) {
  tape('isWritable('  + type + ')', function (t) {
    t.plan(1)
    t.ok(pass === isWritable(stream), type)
  })
}


function testDuplex (pass, type, stream) {
  tape('isDuplex('  + type + ')', function (t) {
    t.plan(1)
    t.ok(pass === isDuplex(stream), type)
  })
}


[ true, false, 0, 1, 1.0, 'string', {}, function foo () {} ].forEach(function (o) {
  test(false, 'non-stream / primitive: ' + (JSON.stringify(o) || o.toString()), o)
})


test(false, 'fake stream obj', { pipe: function () {} })


;(function () {

  // looks like a stream!

  function Stream () {
    EE.call(this)
  }
  util.inherits(Stream, EE)
  Stream.prototype.pipe = function () {}
  Stream.Stream = Stream

  test(false, 'fake stream "new Stream()"', new Stream())

}())


test(true, 'CoreStreams.Stream', new (CoreStreams.Stream)())<commit_msg>falsey tests<commit_after>var tape             = require('tape')
  , EE               = require('events').EventEmitter
  , util             = require('util')


  , isStream         = require('./')
  , isReadable       = require('./').isReadable
  , isWritable       = require('./').isWritable
  , isDuplex         = require('./').isDuplex

  , CoreStreams      = require('stream')
  , ReadableStream10 = require('./readable-stream-1.0/')
  , ReadableStream11 = require('./readable-stream-1.1/')


function test (pass, type, stream) {
  tape('isStream('  + type + ')', function (t) {
    t.plan(1)
    t.ok(pass === isStream(stream), type)
  })
}


function testReadable (pass, type, stream) {
  tape('isReadable('  + type + ')', function (t) {
    t.plan(1)
    t.ok(pass === isReadable(stream), type)
  })
}


function testWritable (pass, type, stream) {
  tape('isWritable('  + type + ')', function (t) {
    t.plan(1)
    t.ok(pass === isWritable(stream), type)
  })
}


function testDuplex (pass, type, stream) {
  tape('isDuplex('  + type + ')', function (t) {
    t.plan(1)
    t.ok(pass === isDuplex(stream), type)
  })
}


[ undefined, null, '', true, false, 0, 1, 1.0, 'string', {}, function foo () {} ].forEach(function (o) {
  test(false, 'non-stream / primitive: ' + (JSON.stringify(o) || (o && o.toString()) || o), o)
})


test(false, 'fake stream obj', { pipe: function () {} })


;(function () {

  // looks like a stream!

  function Stream () {
    EE.call(this)
  }
  util.inherits(Stream, EE)
  Stream.prototype.pipe = function () {}
  Stream.Stream = Stream

  test(false, 'fake stream "new Stream()"', new Stream())

}())


test(true, 'CoreStreams.Stream', new (CoreStreams.Stream)())
{'fraction_non_alphanumeric': 0.19982238010657194, 'fraction_numerical': 0.009473060982830076, 'mean_word_length': 2.924506387921022, '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': '577164', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1173, 'n_words': 244}