Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: appengine/monorail/static/js/tracker/ac_test.js

Issue 1868553004: Open Source Monorail (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /* Copyright 2016 The Chromium Authors. All Rights Reserved.
2 *
3 * Use of this source code is governed by a BSD-style
4 * license that can be found in the LICENSE file or at
5 * https://developers.google.com/open-source/licenses/bsd
6 */
7
8 var firstCharMap;
9
10 function setUp() {
11 firstCharMap = new Object();
12 }
13
14 function testAddItemToFirstCharMap_OneWordLabel() {
15 _AC_AddItemToFirstCharMap(firstCharMap, 'h', 'Hot');
16 var hArray = firstCharMap['h'];
17 assertEquals(1, hArray.length);
18 assertEquals('Hot', hArray[0].value);
19
20 _AC_AddItemToFirstCharMap(firstCharMap, '-', '-Hot');
21 _AC_AddItemToFirstCharMap(firstCharMap, 'h', '-Hot');
22 var minusArray = firstCharMap['-'];
23 assertEquals(1, minusArray.length);
24 assertEquals('-Hot', minusArray[0].value);
25 hArray = firstCharMap['h'];
26 assertEquals(2, hArray.length);
27 assertEquals('Hot', hArray[0].value);
28 assertEquals('-Hot', hArray[1].value);
29 }
30
31 function testAddItemToFirstCharMap_KeyValueLabels() {
32 _AC_AddItemToFirstCharMap(firstCharMap, 'p', 'Priority-High');
33 _AC_AddItemToFirstCharMap(firstCharMap, 'h', 'Priority-High');
34 var pArray = firstCharMap['p'];
35 assertEquals(1, pArray.length);
36 assertEquals('Priority-High', pArray[0].value);
37 var hArray = firstCharMap['h'];
38 assertEquals(1, hArray.length);
39 assertEquals('Priority-High', hArray[0].value);
40 }
OLDNEW
« no previous file with comments | « appengine/monorail/static/js/tracker/ac.js ('k') | appengine/monorail/static/js/tracker/externs.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698