source:
trunk/workshop-routing-foss4g/web/ext/test/unit/util/JSON.js
@
78
Revision 76, 797 bytes checked in by djay, 13 years ago (diff) | |
---|---|
|
Line | |
---|---|
1 | /*! |
2 | * Ext JS Library 3.4.0 |
3 | * Copyright(c) 2006-2011 Sencha Inc. |
4 | * licensing@sencha.com |
5 | * http://www.sencha.com/license |
6 | */ |
7 | Ext.test.session.addTest( 'Ext.util', { |
8 | |
9 | name: 'JSON', |
10 | |
11 | planned: 4, |
12 | |
13 | // same as Ext.encode |
14 | // 1 |
15 | test_encode: function() { |
16 | Y.Assert.areEqual( '{"foo":"bar"}', Ext.util.JSON.encode( { foo: 'bar' } ), 'Test encode with simple object' ); |
17 | }, |
18 | |
19 | // same as Ext.decode |
20 | // 2 |
21 | test_decode: function() { |
22 | Y.ObjectAssert.hasKeys({ |
23 | foo: 'bar' |
24 | }, Ext.util.JSON.decode( '{"foo":"bar"}' ), 'Test decode with a simple object'); |
25 | Y.ObjectAssert.hasKeys({ |
26 | foo: ['bar','baz'] |
27 | }, Ext.util.JSON.decode( '{"foo":["bar","baz"]}' ), 'Test decode with a hash + array'); |
28 | } |
29 | |
30 | // encodeDate |
31 | |
32 | }); |
Note: See TracBrowser
for help on using the repository browser.