source: Dev/trunk/src/client/dojo/tests/_base/object.js

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 862 bytes
Line 
1define(["doh", "dojo/_base/lang"], function(doh, lang){
2
3// setup the test object
4dojo = dojo || {};
5dojo.zoo = { a:1, c: { d:1 } };
6
7        doh.register("tests._base.object", [
8
9                function getBasic(t){
10                        var x = lang.getObject('dojo.zoo.a');
11                        t.is(1, x);
12                },
13
14                function setObject2(t){
15                        lang.setObject("dojo.zoo.foo.bar", 42);
16                        t.is(42, dojo.zoo.foo.bar);
17                },
18
19                function setWithContext(t){
20                        // c is already {}
21                        lang.setObject("zoo.c.x", "foo!", dojo);
22                        t.is("foo!", dojo.zoo.c.x);
23                },
24
25                function getUndefined(t){
26                        var x = lang.getObject('dojo.zoo.b');
27                        t.is(undefined, x);
28                },
29
30                function setDeep(t){
31                        lang.setObject("dojo.zoo.c.e.f.g.h.i", 42);
32                        t.is(42, dojo.zoo.c.e.f.g.h.i);
33                },
34
35                function getDeep(t){
36                        lang.getObject("dojo.zoo.bar.baz.bam", true);
37                        dojo.zoo.bar.baz.bam.x = 10;
38                        t.is(10, dojo.zoo.bar.baz.bam.x);
39                }
40
41        ]);
42});
Note: See TracBrowser for help on using the repository browser.