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

Unified Diff: pkg/mock/lib/src/util.dart

Issue 233243007: pkg/mock: restructure library layout (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/mock/lib/src/times_matcher.dart ('k') | pkg/mock/pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/mock/lib/src/util.dart
diff --git a/pkg/mock/lib/src/util.dart b/pkg/mock/lib/src/util.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5341b88029e6d40871d1b740d27fd12ac099ede9
--- /dev/null
+++ b/pkg/mock/lib/src/util.dart
@@ -0,0 +1,28 @@
+// 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 mock.util;
+
+import 'package:matcher/matcher.dart';
+
+/** Utility function for optionally qualified method names */
+String qualifiedName(owner, String method) {
+ if (owner == null || identical(owner, anything)) {
+ return method;
+ } else if (owner is Matcher) {
+ Description d = new StringDescription();
+ d.addDescriptionOf(owner);
+ d.add('.');
+ d.add(method);
+ return d.toString();
+ } else {
+ return '$owner.$method';
+ }
+}
+
+/** Sentinel value for representing no argument. */
+class _Sentinel {
+ const _Sentinel();
+}
+const NO_ARG = const _Sentinel();
« no previous file with comments | « pkg/mock/lib/src/times_matcher.dart ('k') | pkg/mock/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698