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

Side by Side Diff: sdk/lib/_internal/dartdoc/test/dartdoc_search_test.dart

Issue 140303009: Remove dartdoc. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 library dartdoc_search_test;
6
7 // TODO(rnystrom): Use "package:" URL (#4968).
8 import '../../../../../pkg/expect/lib/expect.dart';
9 import '../lib/src/dartdoc/nav.dart';
10 import '../lib/src/client/search.dart';
11
12 const String URL = 'dummy-url';
13
14 testTopLevelVsMembers() {
15 var search = new SearchText('timer');
16 var match = obtainMatch(search, 'timer');
17 // Matching a top-level field 'timer';
18 var topLevelResult = new Result(match, FIELD, URL);
19 // Matching a member field 'timer' in 'Foo';
20 var memberResult = new Result(match, FIELD, URL, type: 'Foo');
21 Expect.equals(-1, resultComparator(topLevelResult, memberResult),
22 "Top level fields should be preferred to member fields");
23 }
24
25 testTopLevelFullVsPrefix() {
26 var search = new SearchText('cancel');
27 var fullMatch = obtainMatch(search, 'cancel');
28 var prefixMatch = obtainMatch(search, 'cancelable');
29 // Matching a top-level method 'cancel';
30 var fullResult = new Result(fullMatch, METHOD, URL);
31 // Matching a top-level method 'cancelable';
32 var prefixResult = new Result(prefixMatch, METHOD, URL);
33 Expect.equals(-1, resultComparator(fullResult, prefixResult),
34 "Full matches should be preferred to prefix matches");
35 }
36
37 testMemberFullVsPrefix() {
38 var search = new SearchText('cancel');
39 var fullMatch = obtainMatch(search, 'cancel');
40 var prefixMatch = obtainMatch(search, 'cancelable');
41 // Matching a member method 'cancel' in 'Isolate';
42 var fullResult = new Result(fullMatch, METHOD, URL, type: 'Isolate');
43 // Matching a member field 'cancelable' in 'Event';
44 var prefixResult = new Result(prefixMatch, FIELD, URL, type: 'Event');
45 Expect.equals(-1, resultComparator(fullResult, prefixResult),
46 "Full matches should be preferred to prefix matches");
47 }
48
49 void main() {
50 testTopLevelVsMembers();
51 testTopLevelFullVsPrefix();
52 testMemberFullVsPrefix();
53 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/dartdoc/static/styles.css ('k') | sdk/lib/_internal/dartdoc/test/dartdoc_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698