X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..6a7e4474cba9d8be4b2ec445e10f1691f7277c50:/test/unit/util/JSON.js diff --git a/test/unit/util/JSON.js b/test/unit/util/JSON.js new file mode 100644 index 00000000..33f2558f --- /dev/null +++ b/test/unit/util/JSON.js @@ -0,0 +1,32 @@ +/*! + * Ext JS Library 3.2.0 + * Copyright(c) 2006-2010 Ext JS, Inc. + * licensing@extjs.com + * http://www.extjs.com/license + */ +Ext.test.session.addTest( 'Ext.util', { + + name: 'JSON', + + planned: 4, + + // same as Ext.encode + // 1 + test_encode: function() { + Y.Assert.areEqual( '{"foo":"bar"}', Ext.util.JSON.encode( { foo: 'bar' } ), 'Test encode with simple object' ); + }, + + // same as Ext.decode + // 2 + test_decode: function() { + Y.ObjectAssert.hasKeys({ + foo: 'bar' + }, Ext.util.JSON.decode( '{"foo":"bar"}' ), 'Test decode with a simple object'); + Y.ObjectAssert.hasKeys({ + foo: ['bar','baz'] + }, Ext.util.JSON.decode( '{"foo":["bar","baz"]}' ), 'Test decode with a hash + array'); + } + + // encodeDate + +});