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

Unified Diff: runtime/vm/isolate_reload_test.cc

Issue 2187433006: RELOAD: Check if an implicit closure needs rebinding at compile time and adjust closure equality. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « runtime/lib/function.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/isolate_reload_test.cc
diff --git a/runtime/vm/isolate_reload_test.cc b/runtime/vm/isolate_reload_test.cc
index d0606800ec541ad349b5b8ae5bfe47c3bed68f2e..a2f1a99c4d6a8104867ca680a124b1e76aec1a2b 100644
--- a/runtime/vm/isolate_reload_test.cc
+++ b/runtime/vm/isolate_reload_test.cc
@@ -1003,11 +1003,11 @@ TEST_CASE(IsolateReload_PendingUnqualifiedCall_StaticToInstance) {
TestCase::SetReloadTestScript(kReloadScript);
- EXPECT_EQ("instance", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("instance", SimpleInvokeStr(lib, "main"));
lib = TestCase::GetReloadErrorOrRootLibrary();
EXPECT_VALID(lib);
- EXPECT_EQ("instance", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("instance", SimpleInvokeStr(lib, "main"));
}
@@ -1043,11 +1043,11 @@ TEST_CASE(IsolateReload_PendingUnqualifiedCall_InstanceToStatic) {
TestCase::SetReloadTestScript(kReloadScript);
- EXPECT_EQ("static", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("static", SimpleInvokeStr(lib, "main"));
lib = TestCase::GetReloadErrorOrRootLibrary();
EXPECT_VALID(lib);
- EXPECT_EQ("static", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("static", SimpleInvokeStr(lib, "main"));
}
@@ -1093,11 +1093,11 @@ TEST_CASE(IsolateReload_PendingConstructorCall_AbstractToConcrete) {
TestCase::SetReloadTestScript(kReloadScript);
- EXPECT_EQ("okay", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("okay", SimpleInvokeStr(lib, "main"));
lib = TestCase::GetReloadErrorOrRootLibrary();
EXPECT_VALID(lib);
- EXPECT_EQ("okay", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("okay", SimpleInvokeStr(lib, "main"));
}
@@ -1143,11 +1143,11 @@ TEST_CASE(IsolateReload_PendingConstructorCall_ConcreteToAbstract) {
TestCase::SetReloadTestScript(kReloadScript);
- EXPECT_EQ("exception", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("exception", SimpleInvokeStr(lib, "main"));
lib = TestCase::GetReloadErrorOrRootLibrary();
EXPECT_VALID(lib);
- EXPECT_EQ("exception", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("exception", SimpleInvokeStr(lib, "main"));
}
@@ -1190,11 +1190,11 @@ TEST_CASE(IsolateReload_PendingStaticCall_DefinedToNSM) {
TestCase::SetReloadTestScript(kReloadScript);
- EXPECT_EQ("exception", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("exception", SimpleInvokeStr(lib, "main"));
lib = TestCase::GetReloadErrorOrRootLibrary();
EXPECT_VALID(lib);
- EXPECT_EQ("exception", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("exception", SimpleInvokeStr(lib, "main"));
}
@@ -1237,11 +1237,11 @@ TEST_CASE(IsolateReload_PendingStaticCall_NSMToDefined) {
TestCase::SetReloadTestScript(kReloadScript);
- EXPECT_EQ("static", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("static", SimpleInvokeStr(lib, "main"));
lib = TestCase::GetReloadErrorOrRootLibrary();
EXPECT_VALID(lib);
- EXPECT_EQ("static", SimpleInvokeStr(lib, "main"));
+ EXPECT_STREQ("static", SimpleInvokeStr(lib, "main"));
}
@@ -1289,6 +1289,46 @@ TEST_CASE(IsolateReload_PendingSuperCall) {
}
+TEST_CASE(IsolateReload_TearOff_Equality) {
+ const char* kScript =
+ "import 'test:isolate_reload_helper';\n"
+ "class C {\n"
+ " foo() => 'old';\n"
+ "}\n"
+ "main() {\n"
+ " var c = new C();\n"
+ " var f1 = c.foo;\n"
+ " reloadTest();\n"
+ " var f2 = c.foo;\n"
+ " return '${f1()} ${f2()} ${f1 == f2} ${identical(f1, f2)}';\n"
+ "}\n";
+
+ Dart_Handle lib = TestCase::LoadTestScript(kScript, NULL);
+ EXPECT_VALID(lib);
+
+ const char* kReloadScript =
+ "import 'test:isolate_reload_helper';\n"
+ "class C {\n"
+ " foo() => 'new';\n"
+ "}\n"
+ "main() {\n"
+ " var c = new C();\n"
+ " var f1 = c.foo;\n"
+ " reloadTest();\n"
+ " var f2 = c.foo;\n"
+ " return '${f1()} ${f2()} ${f1 == f2} ${identical(f1, f2)}';\n"
+ "}\n";
+
+ TestCase::SetReloadTestScript(kReloadScript);
+
+ EXPECT_STREQ("new new true false", SimpleInvokeStr(lib, "main"));
+
+ lib = TestCase::GetReloadErrorOrRootLibrary();
+ EXPECT_VALID(lib);
+}
+
+
+
TEST_CASE(IsolateReload_EnumEquality) {
const char* kScript =
"enum Fruit {\n"
« no previous file with comments | « runtime/lib/function.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698