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

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

Issue 14088002: Attempt to re-commit Dartdoc exports. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/dartdoc/test/export_map_test.dart ('k') | utils/apidoc/apidoc.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 import 'package:unittest/unittest.dart';
6
7 import '../lib/src/dartdoc/utils.dart';
8
9 void main() {
10 group('countOccurrences', () {
11 test('empty text returns 0', () {
12 expect(countOccurrences('', 'needle'), equals(0));
13 });
14
15 test('one occurrence', () {
16 expect(countOccurrences('bananarama', 'nara'), equals(1));
17 });
18
19 test('multiple occurrences', () {
20 expect(countOccurrences('bananarama', 'a'), equals(5));
21 });
22
23 test('overlapping matches do not count', () {
24 expect(countOccurrences('bananarama', 'ana'), equals(1));
25 });
26 });
27
28 group('repeat', () {
29 test('zero times returns an empty string', () {
30 expect(repeat('ba', 0), isEmpty);
31 });
32
33 test('one time returns the string', () {
34 expect(repeat('ba', 1), equals('ba'));
35 });
36
37 test('multiple times', () {
38 expect(repeat('ba', 3), equals('bababa'));
39 });
40
41 test('multiple times with a separator', () {
42 expect(repeat('ba', 3, separator: ' '), equals('ba ba ba'));
43 });
44 });
45 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/dartdoc/test/export_map_test.dart ('k') | utils/apidoc/apidoc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698