038791a166
R=rnystrom@google.com Review URL: https://codereview.chromium.org//299973002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36815 260f80e4-7a28-3924-810f-c04153c831b5
19 lines
676 B
Dart
19 lines
676 B
Dart
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
library string_scanner.test.utils;
|
|
|
|
import 'package:string_scanner/string_scanner.dart';
|
|
import 'package:unittest/unittest.dart';
|
|
|
|
/// Returns a matcher that asserts that a closure throws a [FormatException]
|
|
/// with the given [message].
|
|
Matcher throwsStringScannerException(String text) {
|
|
return throwsA(predicate((error) {
|
|
expect(error, new isInstanceOf<StringScannerException>());
|
|
expect(error.span.text, equals(text));
|
|
return true;
|
|
}));
|
|
}
|