1 if(!dojo._hasResource["dojox.collections.tests.BinaryTree"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2 dojo._hasResource["dojox.collections.tests.BinaryTree"] = true;
3 dojo.provide("dojox.collections.tests.BinaryTree");
4 dojo.require("dojox.collections.BinaryTree");
6 tests.register("dojox.collections.tests.BinaryTree", [
8 var bt=new dojox.collections.BinaryTree("foo");
9 t.assertTrue(bt instanceof dojox.collections.BinaryTree);
12 var bt=new dojox.collections.BinaryTree("foo");
18 t.assertEqual("apple,bar,baz,buck,foo,shot",bt.toString());
20 function testClear(t){
21 var bt=new dojox.collections.BinaryTree("foo");
28 t.assertEqual(bt.count, 0);
30 function testClone(t){
31 var bt=new dojox.collections.BinaryTree("foo");
38 t.assertEqual(bt2.count, 6);
39 t.assertEqual(bt.toString(), bt2.toString());
41 function testContains(t){
42 var bt=new dojox.collections.BinaryTree("foo");
48 t.assertTrue(bt.contains("buck"));
49 t.assertFalse(bt.contains("duck"));
51 function testDeleteData(t){
52 var bt=new dojox.collections.BinaryTree("foo");
58 bt.deleteData("buck");
59 t.assertEqual("apple,bar,baz,foo,shot",bt.toString());
61 function testGetIterator(t){
62 var bt=new dojox.collections.BinaryTree("foo");
68 var itr=bt.getIterator();
69 while(!itr.atEnd()){ itr.get(); }
70 t.assertEqual("shot", itr.element);
72 function testSearch(t){
73 var bt=new dojox.collections.BinaryTree("foo");
79 t.assertEqual("buck", bt.search("buck").value);