You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
487 B
18 lines
487 B
var inspect = require('../'); |
|
var test = require('tape'); |
|
|
|
test('function', function (t) { |
|
t.plan(1); |
|
var obj = [ 1, 2, function f (n) {}, 4 ]; |
|
t.equal(inspect(obj), '[ 1, 2, [Function: f], 4 ]'); |
|
}); |
|
|
|
test('function name', function (t) { |
|
t.plan(1); |
|
var f = (function () { |
|
return function () {}; |
|
}()); |
|
f.toString = function () { return 'function xxx () {}' }; |
|
var obj = [ 1, 2, f, 4 ]; |
|
t.equal(inspect(obj), '[ 1, 2, [Function: xxx], 4 ]'); |
|
});
|
|
|