mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-22 16:40:51 +00:00
28 lines
693 B
JavaScript
28 lines
693 B
JavaScript
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 ]');
|
|
});
|
|
|
|
test('anon function', function (t) {
|
|
var f = (function () {
|
|
return function () {};
|
|
}());
|
|
var obj = [ 1, 2, f, 4 ];
|
|
t.equal(inspect(obj), '[ 1, 2, [Function], 4 ]');
|
|
|
|
t.end();
|
|
});
|