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

Side by Side Diff: third_party/pkg/route_hierarchical/test/pattern_test.dart

Issue 124053002: Adding Angular and dependent packages for testing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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) 2013, 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 import 'package:route_hierarchical/pattern.dart';
7
8 main() {
9 test('matchAny', () {
10 var p = matchAny(['a', 'b'], exclude: ['ac', 'aa']);
11 expect(p.allMatches('a').map(matchValue), ['a']);
12 expect(p.allMatches('ab').map(matchValue), ['a', 'b']);
13 expect(p.allMatches('aa').map(matchValue), []);
14 expect(p.allMatches('bb').map(matchValue), ['b', 'b']);
15 expect(p.allMatches('aca').map(matchValue), []);
16 });
17
18 test('matchesFull', () {
19 expect(matchesFull('a', 'aa'), false);
20 expect(matchesFull('aa', 'aa'), true);
21 });
22 }
23
24 String matchValue(Match m) => m.input.substring(m.start, m.end);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698