michael@0: // |reftest| skip-if(!xulRuntime.shell) michael@0: // -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: // Any copyright is dedicated to the Public Domain. michael@0: // http://creativecommons.org/licenses/publicdomain/ michael@0: michael@0: function testEq(b) { michael@0: var a = deserialize(serialize(b)); michael@0: assertEq(a, b); michael@0: } michael@0: michael@0: testEq(void 0); michael@0: testEq(null); michael@0: michael@0: testEq(true); michael@0: testEq(false); michael@0: michael@0: testEq(0); michael@0: testEq(-0); michael@0: testEq(1/0); michael@0: testEq(-1/0); michael@0: testEq(0/0); michael@0: testEq(Math.PI); michael@0: michael@0: testEq(""); michael@0: testEq("\0"); michael@0: testEq("a"); // unit string michael@0: testEq("ab"); // length-2 string michael@0: testEq("abc\0123\r\n"); // nested null character michael@0: testEq("\xff\x7f\u7fff\uffff\ufeff\ufffe"); // random unicode stuff michael@0: testEq("\ud800 \udbff \udc00 \udfff"); // busted surrogate pairs michael@0: testEq(Array(1024).join(Array(1024).join("x"))); // 2MB string michael@0: michael@0: reportCompare(0, 0, 'ok');