]> git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/node_modules/grim/node_modules/emissary/node_modules/es6-weak-map/node_modules/es5-ext/test/object/unserialize.js
405eef112ff76e5693935e6461ef24b97caf299f
[rbdr/dotfiles] / atom / packages / vim-mode / node_modules / grim / node_modules / emissary / node_modules / es6-weak-map / node_modules / es5-ext / test / object / unserialize.js
1 'use strict';
2
3 module.exports = function (t, a) {
4 var fn = function (raz, dwa) { return raz + dwa; };
5 a(t('undefined'), undefined, "Undefined");
6 a(t('null'), null, "Null");
7 a(t('"raz"'), 'raz', "String");
8 a(t('"raz\\"ddwa\\ntrzy"'), 'raz"ddwa\ntrzy', "String with escape");
9 a(t('false'), false, "Booelean");
10 a(String(t(String(fn))), String(fn), "Function");
11
12 a.deep(t('/raz-dwa/g'), /raz-dwa/g, "RegExp");
13 a.deep(t('new Date(1234567)'), new Date(1234567), "Date");
14 a.deep(t('[]'), [], "Empty array");
15 a.deep(t('[undefined,false,null,"raz\\"ddwa\\ntrzy",/raz/g,new Date(1234567),["foo"]]'),
16 [undefined, false, null, 'raz"ddwa\ntrzy', /raz/g, new Date(1234567), ['foo']], "Rich Array");
17 a.deep(t('{}'), {}, "Empty object");
18 a.deep(t('{"raz":undefined,"dwa":false,"trzy":null,"cztery":"raz\\"ddwa\\ntrzy",' +
19 '"szesc":/raz/g,"siedem":new Date(1234567),"osiem":["foo",32],' +
20 '"dziewiec":{"foo":"bar","dwa":343}}'),
21 { raz: undefined, dwa: false, trzy: null, cztery: 'raz"ddwa\ntrzy', szesc: /raz/g,
22 siedem: new Date(1234567), osiem: ['foo', 32], dziewiec: { foo: 'bar', dwa: 343 } },
23 "Rich object");
24 };