GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — angular.js/test/ApiSpecs.js at master · ijazfx/angular.js Expand file tree/ Copy pathApiSpecs.jsMore file actions 57 lines (49 loc) · 1.58 KB / Copy pathApiSpecs.jsFile metadata and controls57 lines (49 loc) · 1.58 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 'use strict'; describe('api', function() { describe('HashMap', function() { it('should do basic crud', function() { var map = new HashMap(); var key = {}; var value1 = {}; var value2 = {}; map.put(key, value1); map.put(key, value2); expect(map.get(key)).toBe(value2); expect(map.get({})).toBe(undefined); expect(map.remove(key)).toBe(value2); expect(map.get(key)).toBe(undefined); }); it('should init from an array', function() { var map = new HashMap(['a','b']); expect(map.get('a')).toBe(0); expect(map.get('b')).toBe(1); expect(map.get('c')).toBe(undefined); }); it('should maintain hashKey for object keys', function() { var map = new HashMap(); var key = {}; map.get(key); expect(key.$$hashKey).toBeDefined(); }); it('should maintain hashKey for function keys', function() { var map = new HashMap(); var key = function() {}; map.get(key); expect(key.$$hashKey).toBeDefined(); }); it('should share hashKey between HashMap by default', function() { var map1 = new HashMap(), map2 = new HashMap(); var key1 = {}, key2 = {}; map1.get(key1); map2.get(key2); expect(key1.$$hashKey).not.toEqual(key2.$$hashKey); }); it('should maintain hashKey per HashMap if flag is passed', function() { var map1 = new HashMap([], true), map2 = new HashMap([], true); var key1 = {}, key2 = {}; map1.get(key1); map2.get(key2); expect(key1.$$hashKey).toEqual(key2.$$hashKey); }); }); }); |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |