OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
7 #include "vm/dart_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
8 #include "vm/thread.h" | 8 #include "vm/thread.h" |
9 #include "vm/unit_test.h" | 9 #include "vm/unit_test.h" |
10 | 10 |
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 EXPECT_VALID(point_class); | 1567 EXPECT_VALID(point_class); |
1568 Dart_Handle elem = Dart_EvaluateExpr(point_class, NewString("m['\"']")); | 1568 Dart_Handle elem = Dart_EvaluateExpr(point_class, NewString("m['\"']")); |
1569 EXPECT_VALID(elem); | 1569 EXPECT_VALID(elem); |
1570 EXPECT(Dart_IsString(elem)); | 1570 EXPECT(Dart_IsString(elem)); |
1571 EXPECT_STREQ("quote", ToCString(elem)); | 1571 EXPECT_STREQ("quote", ToCString(elem)); |
1572 | 1572 |
1573 elem = Dart_EvaluateExpr(point_class, NewString("m[\"\\t\"]")); | 1573 elem = Dart_EvaluateExpr(point_class, NewString("m[\"\\t\"]")); |
1574 EXPECT_VALID(elem); | 1574 EXPECT_VALID(elem); |
1575 EXPECT(Dart_IsString(elem)); | 1575 EXPECT(Dart_IsString(elem)); |
1576 EXPECT_STREQ("tab", ToCString(elem)); | 1576 EXPECT_STREQ("tab", ToCString(elem)); |
| 1577 |
| 1578 res = Dart_EvaluateExpr(script_lib, NewString("l..add(11)..add(-5)")); |
| 1579 EXPECT_VALID(res); |
| 1580 // List l now has 5 elements. |
| 1581 |
| 1582 len = Dart_EvaluateExpr(script_lib, NewString("l.length + 1")); |
| 1583 EXPECT_VALID(len); |
| 1584 EXPECT(Dart_IsNumber(len)); |
| 1585 EXPECT_EQ(6, ToInt64(len)); |
1577 } | 1586 } |
1578 | 1587 |
1579 | 1588 |
1580 TEST_CASE(Debug_GetSupertype) { | 1589 TEST_CASE(Debug_GetSupertype) { |
1581 const char* kScriptChars = | 1590 const char* kScriptChars = |
1582 "class Test {\n" | 1591 "class Test {\n" |
1583 "}\n" | 1592 "}\n" |
1584 "class Test1 extends Test {\n" | 1593 "class Test1 extends Test {\n" |
1585 "}\n" | 1594 "}\n" |
1586 "class Test2<T> {\n" | 1595 "class Test2<T> {\n" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1716 | 1725 |
1717 Dart_Handle list_type = Dart_InstanceGetType(list_access_test_obj); | 1726 Dart_Handle list_type = Dart_InstanceGetType(list_access_test_obj); |
1718 Dart_Handle super_type = Dart_GetSupertype(list_type); | 1727 Dart_Handle super_type = Dart_GetSupertype(list_type); |
1719 EXPECT(!Dart_IsError(super_type)); | 1728 EXPECT(!Dart_IsError(super_type)); |
1720 super_type = Dart_GetSupertype(super_type); | 1729 super_type = Dart_GetSupertype(super_type); |
1721 EXPECT(!Dart_IsError(super_type)); | 1730 EXPECT(!Dart_IsError(super_type)); |
1722 EXPECT(super_type == Dart_Null()); | 1731 EXPECT(super_type == Dart_Null()); |
1723 } | 1732 } |
1724 | 1733 |
1725 } // namespace dart | 1734 } // namespace dart |
OLD | NEW |