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

Unified Diff: tests/language/type_vm_test.dart

Issue 10800002: Hide names of internal classes from the user by mapping them to the documented (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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/type_cast_vm_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/type_vm_test.dart
===================================================================
--- tests/language/type_vm_test.dart (revision 9747)
+++ tests/language/type_vm_test.dart (working copy)
@@ -1,7 +1,7 @@
// 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.
-// VMOptions=--enable_type_checks --enable_asserts
+// VMOptions=--enable_type_checks --no_show_internal_names
//
// Dart test program testing type checks.
@@ -37,7 +37,7 @@
List<int> a = new List<int>(1);
a[0] = 0;
a[index()]++; // Type check succeeds, but does not create side effects.
- assert(a[0] == 1);
+ Expect.equals(1, a[0]);
} catch (TypeError error) {
result = 100;
}
@@ -368,7 +368,7 @@
}
String subs = error.url.substring(pos + 1, error.url.length);
Expect.equals("type_vm_test.dart", subs);
- Expect.equals(472, error.line);
+ Expect.equals(560, error.line);
Expect.equals(12, error.column);
}
return result;
@@ -392,16 +392,49 @@
List<int> ai = a;
} catch (TypeError error) {
result++;
+ Expect.equals("List<int>", error.dstType);
+ Expect.equals("List<Object>", error.srcType);
+ Expect.equals("ai", error.dstName);
+ int pos = error.url.lastIndexOf("/", error.url.length);
+ if (pos == -1) {
+ pos = error.url.lastIndexOf("\\", error.url.length);
+ }
+ String subs = error.url.substring(pos + 1, error.url.length);
+ Expect.equals("type_vm_test.dart", subs);
+ Expect.equals(392, error.line);
+ Expect.equals(24, error.column);
}
try {
List<num> an = a;
} catch (TypeError error) {
result++;
+ Expect.equals("List<num>", error.dstType);
+ Expect.equals("List<Object>", error.srcType);
+ Expect.equals("an", error.dstName);
+ int pos = error.url.lastIndexOf("/", error.url.length);
+ if (pos == -1) {
+ pos = error.url.lastIndexOf("\\", error.url.length);
+ }
+ String subs = error.url.substring(pos + 1, error.url.length);
+ Expect.equals("type_vm_test.dart", subs);
+ Expect.equals(408, error.line);
+ Expect.equals(24, error.column);
}
try {
List<String> as = a;
} catch (TypeError error) {
result++;
+ Expect.equals("List<String>", error.dstType);
+ Expect.equals("List<Object>", error.srcType);
+ Expect.equals("as", error.dstName);
+ int pos = error.url.lastIndexOf("/", error.url.length);
+ if (pos == -1) {
+ pos = error.url.lastIndexOf("\\", error.url.length);
+ }
+ String subs = error.url.substring(pos + 1, error.url.length);
+ Expect.equals("type_vm_test.dart", subs);
+ Expect.equals(424, error.line);
+ Expect.equals(27, error.column);
}
}
{
@@ -414,6 +447,17 @@
List<String> as = a;
} catch (TypeError error) {
result++;
+ Expect.equals("List<String>", error.dstType);
+ Expect.equals("List<int>", error.srcType);
+ Expect.equals("as", error.dstName);
+ int pos = error.url.lastIndexOf("/", error.url.length);
+ if (pos == -1) {
+ pos = error.url.lastIndexOf("\\", error.url.length);
+ }
+ String subs = error.url.substring(pos + 1, error.url.length);
+ Expect.equals("type_vm_test.dart", subs);
+ Expect.equals(447, error.line);
+ Expect.equals(27, error.column);
}
}
{
@@ -424,12 +468,34 @@
List<int> ai = a;
} catch (TypeError error) {
result++;
+ Expect.equals("List<int>", error.dstType);
+ Expect.equals("List<num>", error.srcType);
+ Expect.equals("ai", error.dstName);
+ int pos = error.url.lastIndexOf("/", error.url.length);
+ if (pos == -1) {
+ pos = error.url.lastIndexOf("\\", error.url.length);
+ }
+ String subs = error.url.substring(pos + 1, error.url.length);
+ Expect.equals("type_vm_test.dart", subs);
+ Expect.equals(468, error.line);
+ Expect.equals(24, error.column);
}
List<num> an = a;
try {
List<String> as = a;
} catch (TypeError error) {
result++;
+ Expect.equals("List<String>", error.dstType);
+ Expect.equals("List<num>", error.srcType);
+ Expect.equals("as", error.dstName);
+ int pos = error.url.lastIndexOf("/", error.url.length);
+ if (pos == -1) {
+ pos = error.url.lastIndexOf("\\", error.url.length);
+ }
+ String subs = error.url.substring(pos + 1, error.url.length);
+ Expect.equals("type_vm_test.dart", subs);
+ Expect.equals(485, error.line);
+ Expect.equals(27, error.column);
}
}
{
@@ -440,11 +506,33 @@
List<int> ai = a;
} catch (TypeError error) {
result++;
+ Expect.equals("List<int>", error.dstType);
+ Expect.equals("List<String>", error.srcType);
+ Expect.equals("ai", error.dstName);
+ int pos = error.url.lastIndexOf("/", error.url.length);
+ if (pos == -1) {
+ pos = error.url.lastIndexOf("\\", error.url.length);
+ }
+ String subs = error.url.substring(pos + 1, error.url.length);
+ Expect.equals("type_vm_test.dart", subs);
+ Expect.equals(506, error.line);
+ Expect.equals(24, error.column);
}
try {
List<num> an = a;
} catch (TypeError error) {
result++;
+ Expect.equals("List<num>", error.dstType);
+ Expect.equals("List<String>", error.srcType);
+ Expect.equals("an", error.dstName);
+ int pos = error.url.lastIndexOf("/", error.url.length);
+ if (pos == -1) {
+ pos = error.url.lastIndexOf("\\", error.url.length);
+ }
+ String subs = error.url.substring(pos + 1, error.url.length);
+ Expect.equals("type_vm_test.dart", subs);
+ Expect.equals(522, error.line);
+ Expect.equals(24, error.column);
}
List<String> as = a;
}
« no previous file with comments | « tests/language/type_cast_vm_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698