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

Unified Diff: sdk/lib/_internal/pub/test/transcript_test.dart

Issue 111103002: Make the solver deterministic (again). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make log discard from the middle. Created 7 years 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 | « sdk/lib/_internal/pub/lib/src/transcript.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/transcript_test.dart
diff --git a/sdk/lib/_internal/pub/test/transcript_test.dart b/sdk/lib/_internal/pub/test/transcript_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..228dfcedb45d1ed9317fd61d0636529b3126997d
--- /dev/null
+++ b/sdk/lib/_internal/pub/test/transcript_test.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2012, 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 version_test;
+
+import 'package:unittest/unittest.dart';
+import 'test_pub.dart';
+import '../lib/src/transcript.dart';
+
+main() {
+ initConfig();
+
+ test('forEach', () {
+ var transcript = new Transcript<String>(4);
+ forEachToString() {
+ var result = "";
+ transcript.forEach((entry) => result += entry, (n) => result += "[$n]");
+ return result;
+ }
+
+ expect(forEachToString(), equals(""));
+ transcript.add("a");
+ expect(forEachToString(), equals("a"));
+ transcript.add("b");
+ expect(forEachToString(), equals("ab"));
+ transcript.add("c");
+ expect(forEachToString(), equals("abc"));
+ transcript.add("d");
+ expect(forEachToString(), equals("abcd"));
+ transcript.add("e");
+ expect(forEachToString(), equals("ab[1]de"));
+ transcript.add("f");
+ expect(forEachToString(), equals("ab[2]ef"));
+ });
+}
nweiz 2013/12/11 06:53:03 Add a test where it doesn't discard entries as wel
Bob Nystrom 2013/12/11 17:40:01 Done.
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/transcript.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698