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

Unified Diff: runtime/vm/object_test.cc

Issue 8773026: Canonicalize TypeArguments. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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 | « runtime/vm/object_store.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_test.cc
===================================================================
--- runtime/vm/object_test.cc (revision 2130)
+++ runtime/vm/object_test.cc (working copy)
@@ -111,6 +111,28 @@
}
+TEST_CASE(TypeArguments) {
+ const Type& type1 = Type::Handle(Type::DoubleInterface());
+ const Type& type2 = Type::Handle(Type::StringInterface());
+ const TypeArguments& type_arguments1 = TypeArguments::Handle(
+ TypeArguments::New(2));
+ type_arguments1.SetTypeAt(0, type1);
+ type_arguments1.SetTypeAt(1, type2);
+ const TypeArguments& type_arguments2 = TypeArguments::Handle(
+ TypeArguments::New(2));
+ type_arguments2.SetTypeAt(0, type1);
+ type_arguments2.SetTypeAt(1, type2);
+ EXPECT_NE(type_arguments1.raw(), type_arguments2.raw());
+ OS::Print("1: %s\n", type_arguments1.ToCString());
+ OS::Print("2: %s\n", type_arguments2.ToCString());
+ ASSERT(type_arguments1.Equals(type_arguments2));
+ TypeArguments& type_arguments3 = TypeArguments::Handle();
+ type_arguments1.Canonicalize();
+ type_arguments3 ^= type_arguments2.Canonicalize();
+ EXPECT_EQ(type_arguments1.raw(), type_arguments3.raw());
+}
+
+
TEST_CASE(TokenStream) {
String& source = String::Handle(String::New("= ( 9 , ."));
String& private_key = String::Handle(String::New(""));
« no previous file with comments | « runtime/vm/object_store.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698