summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/concat-stream/test/infer.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/concat-stream/test/infer.js')
-rw-r--r--tools/eslint/node_modules/concat-stream/test/infer.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/concat-stream/test/infer.js b/tools/eslint/node_modules/concat-stream/test/infer.js
new file mode 100644
index 0000000000..91ab933f45
--- /dev/null
+++ b/tools/eslint/node_modules/concat-stream/test/infer.js
@@ -0,0 +1,15 @@
+var concat = require('../')
+var test = require('tape')
+
+test('type inference works as expected', function(t) {
+ var stream = concat()
+ t.equal(stream.inferEncoding(['hello']), 'array', 'array')
+ t.equal(stream.inferEncoding(new Buffer('hello')), 'buffer', 'buffer')
+ t.equal(stream.inferEncoding(undefined), 'buffer', 'buffer')
+ t.equal(stream.inferEncoding(new Uint8Array(1)), 'uint8array', 'uint8array')
+ t.equal(stream.inferEncoding('hello'), 'string', 'string')
+ t.equal(stream.inferEncoding(''), 'string', 'string')
+ t.equal(stream.inferEncoding({hello: "world"}), 'object', 'object')
+ t.equal(stream.inferEncoding(1), 'buffer', 'buffer')
+ t.end()
+})