Index: runtime/vm/dart_api_impl_test.cc |
diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc |
index f953ef2f3c58c395c1313ca10b43cc906b2135cf..b043969d1ed5a2204b08009b48c10f45bb943940 100644 |
--- a/runtime/vm/dart_api_impl_test.cc |
+++ b/runtime/vm/dart_api_impl_test.cc |
@@ -201,6 +201,11 @@ TEST_CASE(IdentityEquals) { |
// Different objects. |
EXPECT(!Dart_IdentityEquals(five, seven)); |
+ // Case where identical() is not the same as pointer equality. |
+ Dart_Handle nan1 = Dart_NewDouble(NAN); |
+ Dart_Handle nan2 = Dart_NewDouble(NAN); |
+ EXPECT(Dart_IdentityEquals(nan1, nan2)); |
+ |
// Non-instance objects. |
{ |
Isolate* isolate = Isolate::Current(); |
@@ -211,6 +216,10 @@ TEST_CASE(IdentityEquals) { |
EXPECT(Dart_IdentityEquals(lib1, lib1)); |
EXPECT(Dart_IdentityEquals(lib2, lib2)); |
EXPECT(!Dart_IdentityEquals(lib1, lib2)); |
+ |
+ // Mix instance and non-instance. |
+ EXPECT(!Dart_IdentityEquals(lib1, nan1)); |
+ EXPECT(!Dart_IdentityEquals(nan1, lib1)); |
} |
} |