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