OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 #include "include/dart_tools_api.h" | 6 #include "include/dart_tools_api.h" |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
10 #include "vm/lockers.h" | 10 #include "vm/lockers.h" |
(...skipping 2162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2173 " Banana,\n" | 2173 " Banana,\n" |
2174 "}\n" | 2174 "}\n" |
2175 "var x;\n" | 2175 "var x;\n" |
2176 "main() {\n" | 2176 "main() {\n" |
2177 " String r = '$x ${x.hashCode is int} ${x.index}';\n" | 2177 " String r = '$x ${x.hashCode is int} ${x.index}';\n" |
2178 " return r;\n" | 2178 " return r;\n" |
2179 "}\n"; | 2179 "}\n"; |
2180 | 2180 |
2181 lib = TestCase::ReloadTestScript(kReloadScript); | 2181 lib = TestCase::ReloadTestScript(kReloadScript); |
2182 EXPECT_VALID(lib); | 2182 EXPECT_VALID(lib); |
2183 EXPECT_STREQ("Fruit.Cantalope true 2", SimpleInvokeStr(lib, "main")); | 2183 EXPECT_STREQ("Deleted enum value from Fruit true -1", |
| 2184 SimpleInvokeStr(lib, "main")); |
2184 } | 2185 } |
2185 | 2186 |
2186 | 2187 |
2187 TEST_CASE(IsolateReload_EnumIdentityReload) { | 2188 TEST_CASE(IsolateReload_EnumIdentityReload) { |
2188 const char* kScript = | 2189 const char* kScript = |
2189 "enum Fruit {\n" | 2190 "enum Fruit {\n" |
2190 " Apple,\n" | 2191 " Apple,\n" |
2191 " Banana,\n" | 2192 " Banana,\n" |
2192 " Cantalope,\n" | 2193 " Cantalope,\n" |
2193 "}\n" | 2194 "}\n" |
(...skipping 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3119 "}\n"; | 3120 "}\n"; |
3120 | 3121 |
3121 lib = TestCase::ReloadTestScript(kReloadScript); | 3122 lib = TestCase::ReloadTestScript(kReloadScript); |
3122 EXPECT_VALID(lib); | 3123 EXPECT_VALID(lib); |
3123 EXPECT_STREQ("value=0:00:02.000000", SimpleInvokeStr(lib, "main")); | 3124 EXPECT_STREQ("value=0:00:02.000000", SimpleInvokeStr(lib, "main")); |
3124 } | 3125 } |
3125 | 3126 |
3126 #endif // !PRODUCT | 3127 #endif // !PRODUCT |
3127 | 3128 |
3128 } // namespace dart | 3129 } // namespace dart |
OLD | NEW |