source: Dev/trunk/src/client/dojox/lang/tests/object.js @ 529

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

Added Dojo 1.9.3 release.

File size: 781 bytes
Line 
1dojo.provide("dojox.lang.tests.object");
2
3dojo.require("dojox.lang.functional.object");
4
5(function(){
6        var df = dojox.lang.functional, x = {a: 1, b: 2, c: 3},
7                print = function(v, i){ this.push("[" + i + "] = " + v); },
8                show = function(o){ return df.forIn(o, print, []).sort().join(", "); };
9       
10        tests.register("dojox.lang.tests.object", [
11                function testKeys(t){ t.assertEqual(df.keys(x).sort(), ["a", "b", "c"]); },
12                function testValues(t){ t.assertEqual(df.values(x).sort(), [1, 2, 3]); },
13               
14                function testForIn(t){ t.assertEqual(show(x), "[a] = 1, [b] = 2, [c] = 3"); },
15                function testFilterIn(t){ t.assertEqual(show(df.filterIn(x, "%2")), "[a] = 1, [c] = 3"); },
16                function testMapIn(t){ t.assertEqual(show(df.mapIn(x, "+3")), "[a] = 4, [b] = 5, [c] = 6"); }
17        ]);
18})();
Note: See TracBrowser for help on using the repository browser.