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

Unified Diff: tests/language/src/SavannahTest.dart

Issue 10248007: test rename overhaul: step 8 - language tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 | « tests/language/src/ReturnInLoopTest.dart ('k') | tests/language/src/ScannerTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/src/SavannahTest.dart
diff --git a/tests/language/src/SavannahTest.dart b/tests/language/src/SavannahTest.dart
deleted file mode 100644
index f8bed94eb4399766d7713085c6d0f22d24e3d7f2..0000000000000000000000000000000000000000
--- a/tests/language/src/SavannahTest.dart
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2011, 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.
-// Dart test using an identity hash.
-
-interface BigGame extends Hashable {
- final String name;
-}
-
-class Giraffe implements BigGame {
- final String name;
- final int identityHash_;
-
- Giraffe(this.name) : identityHash_ = nextId() {}
-
- int hashCode() {
- return identityHash_;
- }
-
- // Calculate identity hash for a giraffe.
- static int nextId_;
- static int nextId() {
- if (nextId_ == null) {
- nextId_ = 17;
- }
- return nextId_++;
- }
-}
-
-class Zebra implements BigGame {
- final String name;
- Zebra(this.name) {}
-}
-
-
-class SavannahTest {
-
- static void testMain() {
- Map<BigGame, String> savannah = new Map<BigGame, String>();
- Giraffe giraffe1 = new Giraffe("Tony");
- Giraffe giraffe2 = new Giraffe("Rose");
- savannah[giraffe1] = giraffe1.name;
- savannah[giraffe2] = giraffe2.name;
-
- var count = savannah.length;
- print("getCount is $count");
- Expect.equals(2, count);
- print("giraffe1: " + savannah[giraffe1]);
- print("giraffe2: " + savannah[giraffe2]);
- Expect.equals("Tony", savannah[giraffe1]);
- Expect.equals("Rose", savannah[giraffe2]);
-
- bool caught = false;
- Zebra zebra1 = new Zebra("Paul");
- Zebra zebra2 = new Zebra("Joe");
- try {
- savannah[zebra1] = zebra1.name;
- savannah[zebra2] = zebra2.name;
- } catch (NoSuchMethodException e) {
- print("Caught: $e");
- caught = true;
- }
- Expect.equals(true, caught);
-
- count = savannah.length;
- print("getCount is $count");
- Expect.equals(2, count);
-
- caught = false;
- try {
- print("zebra1: " + savannah[zebra1]);
- print("zebra2: " + savannah[zebra2]);
- } catch (NoSuchMethodException e) {
- print("Caught: $e");
- caught = true;
- }
- Expect.equals(true, caught);
- }
-
-}
-
-main() {
- SavannahTest.testMain();
-}
« no previous file with comments | « tests/language/src/ReturnInLoopTest.dart ('k') | tests/language/src/ScannerTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698