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

Unified Diff: pkg/analyzer-experimental/lib/src/generated/java_junit.dart

Issue 12197019: Drop of generated scanner and example scanner driver. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer-experimental/lib/src/generated/java_junit.dart
===================================================================
--- pkg/analyzer-experimental/lib/src/generated/java_junit.dart (revision 0)
+++ pkg/analyzer-experimental/lib/src/generated/java_junit.dart (revision 0)
@@ -0,0 +1,109 @@
+library java.junit;
+
+import 'package:unittest/unittest.dart' hide fail;
+import 'package:unittest/unittest.dart' as _ut show fail;
+
+
+class JUnitTestCase {
+ void setUp() {}
+ void tearDown() {}
+ static void fail(String msg) {
+ _ut.fail(msg);
+ }
+ static void assertTrue(bool x) {
+ expect(x, isTrue);
+ }
+ static void assertTrueMsg(String msg, bool x) {
+ expect(x, isTrueMsg(msg));
+ }
+ static void assertFalse(bool x) {
+ expect(x, isFalse);
+ }
+ static void assertFalseMsg(String msg, bool x) {
+ expect(x, isFalseMsg(msg));
+ }
+ static void assertNull(x) {
+ expect(x, isNull);
+ }
+ static void assertNotNull(x) {
+ expect(x, isNotNull);
+ }
+ static void assertEquals(expected, actual) {
+ expect(actual, equals(expected));
+ }
+ static void assertEqualsMsg(String msg, expected, actual) {
+ expect(actual, equalsMsg(msg, expected));
+ }
+}
+
+runJUnitTest(testInstance, Function testFunction) {
+ testInstance.setUp();
+ try {
+ testFunction();
+ } finally {
+ testInstance.tearDown();
+ }
+}
+
+/**
+ * Returns a matches that matches if the value is not the same instance
+ * as [object] (`!==`).
+ */
+Matcher notSame(expected) => new _IsNotSameAs(expected);
+
+class _IsNotSameAs extends BaseMatcher {
+ final _expected;
+ const _IsNotSameAs(this._expected);
+ bool matches(item, MatchState matchState) => !identical(item, _expected);
+ Description describe(Description description) =>
+ description.add('not same instance as ').addDescriptionOf(_expected);
+}
+
+Matcher equalsMsg(String msg, expected) => new _EqualsWithMessage(msg, expected);
+class _EqualsWithMessage extends BaseMatcher {
+ final String msg;
+ final expectedValue;
+ const _EqualsWithMessage(this.msg, this.expectedValue);
+ bool matches(item, MatchState matchState) {
+ return item == expectedValue;
+ }
+ Description describe(Description mismatchDescription) {
+ return mismatchDescription.replace(msg);
+ }
+ Description describeMismatch(item, Description mismatchDescription,
+ MatchState matchState, bool verbose) {
+ return mismatchDescription.replace(msg).add(" $item != $expectedValue");
+ }
+}
+
+Matcher isTrueMsg(String msg) => new _IsTrueWithMessage(msg);
+class _IsTrueWithMessage extends BaseMatcher {
+ final String msg;
+ const _IsTrueWithMessage(this.msg);
+ bool matches(item, MatchState matchState) {
+ return item == true;
+ }
+ Description describe(Description mismatchDescription) {
+ return mismatchDescription.replace(msg);
+ }
+ Description describeMismatch(item, Description mismatchDescription,
+ MatchState matchState, bool verbose) {
+ return mismatchDescription.replace(msg).add(" $item is not true");
+ }
+}
+
+Matcher isFalseMsg(String msg) => new _IsFalseWithMessage(msg);
+class _IsFalseWithMessage extends BaseMatcher {
+ final String msg;
+ const _IsFalseWithMessage(this.msg);
+ bool matches(item, MatchState matchState) {
+ return item == false;
+ }
+ Description describe(Description mismatchDescription) {
+ return mismatchDescription.replace(msg);
+ }
+ Description describeMismatch(item, Description mismatchDescription,
+ MatchState matchState, bool verbose) {
+ return mismatchDescription.replace(msg).add(" $item is not false");
+ }
+}
« no previous file with comments | « pkg/analyzer-experimental/lib/src/generated/java_engine.dart ('k') | pkg/analyzer-experimental/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698