| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.utilities_test; | 8 library engine.utilities_test; |
| 9 | 9 |
| 10 import 'dart:collection'; | 10 import 'dart:collection'; |
| (...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1582 } | 1582 } |
| 1583 } | 1583 } |
| 1584 } | 1584 } |
| 1585 | 1585 |
| 1586 @reflectiveTest | 1586 @reflectiveTest |
| 1587 class BooleanArrayTest { | 1587 class BooleanArrayTest { |
| 1588 void test_get_negative() { | 1588 void test_get_negative() { |
| 1589 try { | 1589 try { |
| 1590 BooleanArray.get(0, -1); | 1590 BooleanArray.get(0, -1); |
| 1591 fail("Expected "); | 1591 fail("Expected "); |
| 1592 } on RangeError catch (exception) { | 1592 } on RangeError { |
| 1593 // Expected | 1593 // Expected |
| 1594 } | 1594 } |
| 1595 } | 1595 } |
| 1596 | 1596 |
| 1597 void test_get_tooBig() { | 1597 void test_get_tooBig() { |
| 1598 try { | 1598 try { |
| 1599 BooleanArray.get(0, 31); | 1599 BooleanArray.get(0, 31); |
| 1600 fail("Expected "); | 1600 fail("Expected "); |
| 1601 } on RangeError catch (exception) { | 1601 } on RangeError { |
| 1602 // Expected | 1602 // Expected |
| 1603 } | 1603 } |
| 1604 } | 1604 } |
| 1605 | 1605 |
| 1606 void test_get_valid() { | 1606 void test_get_valid() { |
| 1607 expect(BooleanArray.get(0, 0), false); | 1607 expect(BooleanArray.get(0, 0), false); |
| 1608 expect(BooleanArray.get(1, 0), true); | 1608 expect(BooleanArray.get(1, 0), true); |
| 1609 expect(BooleanArray.get(0, 30), false); | 1609 expect(BooleanArray.get(0, 30), false); |
| 1610 expect(BooleanArray.get(1 << 30, 30), true); | 1610 expect(BooleanArray.get(1 << 30, 30), true); |
| 1611 } | 1611 } |
| 1612 | 1612 |
| 1613 void test_set_negative() { | 1613 void test_set_negative() { |
| 1614 try { | 1614 try { |
| 1615 BooleanArray.set(0, -1, true); | 1615 BooleanArray.set(0, -1, true); |
| 1616 fail("Expected "); | 1616 fail("Expected "); |
| 1617 } on RangeError catch (exception) { | 1617 } on RangeError { |
| 1618 // Expected | 1618 // Expected |
| 1619 } | 1619 } |
| 1620 } | 1620 } |
| 1621 | 1621 |
| 1622 void test_set_tooBig() { | 1622 void test_set_tooBig() { |
| 1623 try { | 1623 try { |
| 1624 BooleanArray.set(0, 32, true); | 1624 BooleanArray.set(0, 32, true); |
| 1625 fail("Expected "); | 1625 fail("Expected "); |
| 1626 } on RangeError catch (exception) { | 1626 } on RangeError { |
| 1627 // Expected | 1627 // Expected |
| 1628 } | 1628 } |
| 1629 } | 1629 } |
| 1630 | 1630 |
| 1631 void test_set_valueChanging() { | 1631 void test_set_valueChanging() { |
| 1632 expect(BooleanArray.set(0, 0, true), 1); | 1632 expect(BooleanArray.set(0, 0, true), 1); |
| 1633 expect(BooleanArray.set(1, 0, false), 0); | 1633 expect(BooleanArray.set(1, 0, false), 0); |
| 1634 expect(BooleanArray.set(0, 30, true), 1 << 30); | 1634 expect(BooleanArray.set(0, 30, true), 1 << 30); |
| 1635 expect(BooleanArray.set(1 << 30, 30, false), 0); | 1635 expect(BooleanArray.set(1 << 30, 30, false), 0); |
| 1636 } | 1636 } |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1764 expect(cycle, hasLength(1)); | 1764 expect(cycle, hasLength(1)); |
| 1765 expect(cycle[0], node); | 1765 expect(cycle[0], node); |
| 1766 } | 1766 } |
| 1767 | 1767 |
| 1768 void test_findCycleContaining_null() { | 1768 void test_findCycleContaining_null() { |
| 1769 DirectedGraph<DirectedGraphTest_Node> graph = | 1769 DirectedGraph<DirectedGraphTest_Node> graph = |
| 1770 new DirectedGraph<DirectedGraphTest_Node>(); | 1770 new DirectedGraph<DirectedGraphTest_Node>(); |
| 1771 try { | 1771 try { |
| 1772 graph.findCycleContaining(null); | 1772 graph.findCycleContaining(null); |
| 1773 fail("Expected IllegalArgumentException"); | 1773 fail("Expected IllegalArgumentException"); |
| 1774 } on IllegalArgumentException catch (exception) { | 1774 } on IllegalArgumentException { |
| 1775 // Expected | 1775 // Expected |
| 1776 } | 1776 } |
| 1777 } | 1777 } |
| 1778 | 1778 |
| 1779 void test_findCycleContaining_singleton() { | 1779 void test_findCycleContaining_singleton() { |
| 1780 DirectedGraphTest_Node node1 = new DirectedGraphTest_Node(); | 1780 DirectedGraphTest_Node node1 = new DirectedGraphTest_Node(); |
| 1781 DirectedGraphTest_Node node2 = new DirectedGraphTest_Node(); | 1781 DirectedGraphTest_Node node2 = new DirectedGraphTest_Node(); |
| 1782 DirectedGraphTest_Node node3 = new DirectedGraphTest_Node(); | 1782 DirectedGraphTest_Node node3 = new DirectedGraphTest_Node(); |
| 1783 DirectedGraph<DirectedGraphTest_Node> graph = | 1783 DirectedGraph<DirectedGraphTest_Node> graph = |
| 1784 new DirectedGraph<DirectedGraphTest_Node>(); | 1784 new DirectedGraph<DirectedGraphTest_Node>(); |
| (...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2783 @reflectiveTest | 2783 @reflectiveTest |
| 2784 class LineInfoTest { | 2784 class LineInfoTest { |
| 2785 void test_creation() { | 2785 void test_creation() { |
| 2786 expect(new LineInfo(<int>[0]), isNotNull); | 2786 expect(new LineInfo(<int>[0]), isNotNull); |
| 2787 } | 2787 } |
| 2788 | 2788 |
| 2789 void test_creation_empty() { | 2789 void test_creation_empty() { |
| 2790 try { | 2790 try { |
| 2791 new LineInfo(<int>[]); | 2791 new LineInfo(<int>[]); |
| 2792 fail("Expected IllegalArgumentException"); | 2792 fail("Expected IllegalArgumentException"); |
| 2793 } on IllegalArgumentException catch (exception) { | 2793 } on IllegalArgumentException { |
| 2794 // Expected | 2794 // Expected |
| 2795 } | 2795 } |
| 2796 } | 2796 } |
| 2797 | 2797 |
| 2798 void test_creation_null() { | 2798 void test_creation_null() { |
| 2799 try { | 2799 try { |
| 2800 new LineInfo(null); | 2800 new LineInfo(null); |
| 2801 fail("Expected IllegalArgumentException"); | 2801 fail("Expected IllegalArgumentException"); |
| 2802 } on IllegalArgumentException catch (exception) { | 2802 } on IllegalArgumentException { |
| 2803 // Expected | 2803 // Expected |
| 2804 } | 2804 } |
| 2805 } | 2805 } |
| 2806 | 2806 |
| 2807 void test_firstLine() { | 2807 void test_firstLine() { |
| 2808 LineInfo info = new LineInfo(<int>[0, 12, 34]); | 2808 LineInfo info = new LineInfo(<int>[0, 12, 34]); |
| 2809 LineInfo_Location location = info.getLocation(4); | 2809 LineInfo_Location location = info.getLocation(4); |
| 2810 expect(location.lineNumber, 1); | 2810 expect(location.lineNumber, 1); |
| 2811 expect(location.columnNumber, 5); | 2811 expect(location.columnNumber, 5); |
| 2812 } | 2812 } |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3187 expect(iterator.moveNext(), isFalse); | 3187 expect(iterator.moveNext(), isFalse); |
| 3188 } | 3188 } |
| 3189 | 3189 |
| 3190 void test_singleMap_empty() { | 3190 void test_singleMap_empty() { |
| 3191 Map<String, String> map = new HashMap<String, String>(); | 3191 Map<String, String> map = new HashMap<String, String>(); |
| 3192 MultipleMapIterator<String, String> iterator = _iterator(<Map>[map]); | 3192 MultipleMapIterator<String, String> iterator = _iterator(<Map>[map]); |
| 3193 expect(iterator.moveNext(), isFalse); | 3193 expect(iterator.moveNext(), isFalse); |
| 3194 try { | 3194 try { |
| 3195 iterator.key; | 3195 iterator.key; |
| 3196 fail("Expected NoSuchElementException"); | 3196 fail("Expected NoSuchElementException"); |
| 3197 } on NoSuchElementException catch (exception) { | 3197 } on NoSuchElementException { |
| 3198 // Expected | 3198 // Expected |
| 3199 } | 3199 } |
| 3200 try { | 3200 try { |
| 3201 iterator.value; | 3201 iterator.value; |
| 3202 fail("Expected NoSuchElementException"); | 3202 fail("Expected NoSuchElementException"); |
| 3203 } on NoSuchElementException catch (exception) { | 3203 } on NoSuchElementException { |
| 3204 // Expected | 3204 // Expected |
| 3205 } | 3205 } |
| 3206 try { | 3206 try { |
| 3207 iterator.value = "x"; | 3207 iterator.value = "x"; |
| 3208 fail("Expected NoSuchElementException"); | 3208 fail("Expected NoSuchElementException"); |
| 3209 } on NoSuchElementException catch (exception) { | 3209 } on NoSuchElementException { |
| 3210 // Expected | 3210 // Expected |
| 3211 } | 3211 } |
| 3212 } | 3212 } |
| 3213 | 3213 |
| 3214 void test_singleMap_multiple() { | 3214 void test_singleMap_multiple() { |
| 3215 Map<String, String> map = new HashMap<String, String>(); | 3215 Map<String, String> map = new HashMap<String, String>(); |
| 3216 map["k1"] = "v1"; | 3216 map["k1"] = "v1"; |
| 3217 map["k2"] = "v2"; | 3217 map["k2"] = "v2"; |
| 3218 map["k3"] = "v3"; | 3218 map["k3"] = "v3"; |
| 3219 MultipleMapIterator<String, String> iterator = _iterator([map]); | 3219 MultipleMapIterator<String, String> iterator = _iterator([map]); |
| (...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4144 @reflectiveTest | 4144 @reflectiveTest |
| 4145 class SingleMapIteratorTest extends EngineTestCase { | 4145 class SingleMapIteratorTest extends EngineTestCase { |
| 4146 void test_empty() { | 4146 void test_empty() { |
| 4147 Map<String, String> map = new HashMap<String, String>(); | 4147 Map<String, String> map = new HashMap<String, String>(); |
| 4148 SingleMapIterator<String, String> iterator = | 4148 SingleMapIterator<String, String> iterator = |
| 4149 new SingleMapIterator<String, String>(map); | 4149 new SingleMapIterator<String, String>(map); |
| 4150 expect(iterator.moveNext(), isFalse); | 4150 expect(iterator.moveNext(), isFalse); |
| 4151 try { | 4151 try { |
| 4152 iterator.key; | 4152 iterator.key; |
| 4153 fail("Expected NoSuchElementException"); | 4153 fail("Expected NoSuchElementException"); |
| 4154 } on NoSuchElementException catch (exception) { | 4154 } on NoSuchElementException { |
| 4155 // Expected | 4155 // Expected |
| 4156 } | 4156 } |
| 4157 try { | 4157 try { |
| 4158 iterator.value; | 4158 iterator.value; |
| 4159 fail("Expected NoSuchElementException"); | 4159 fail("Expected NoSuchElementException"); |
| 4160 } on NoSuchElementException catch (exception) { | 4160 } on NoSuchElementException { |
| 4161 // Expected | 4161 // Expected |
| 4162 } | 4162 } |
| 4163 try { | 4163 try { |
| 4164 iterator.value = "x"; | 4164 iterator.value = "x"; |
| 4165 fail("Expected NoSuchElementException"); | 4165 fail("Expected NoSuchElementException"); |
| 4166 } on NoSuchElementException catch (exception) { | 4166 } on NoSuchElementException { |
| 4167 // Expected | 4167 // Expected |
| 4168 } | 4168 } |
| 4169 expect(iterator.moveNext(), isFalse); | 4169 expect(iterator.moveNext(), isFalse); |
| 4170 } | 4170 } |
| 4171 | 4171 |
| 4172 void test_multiple() { | 4172 void test_multiple() { |
| 4173 Map<String, String> map = new HashMap<String, String>(); | 4173 Map<String, String> map = new HashMap<String, String>(); |
| 4174 map["k1"] = "v1"; | 4174 map["k1"] = "v1"; |
| 4175 map["k2"] = "v2"; | 4175 map["k2"] = "v2"; |
| 4176 map["k3"] = "v3"; | 4176 map["k3"] = "v3"; |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4439 expect(StringUtilities.isTagName("a0"), isTrue); | 4439 expect(StringUtilities.isTagName("a0"), isTrue); |
| 4440 expect(StringUtilities.isTagName("a"), isTrue); | 4440 expect(StringUtilities.isTagName("a"), isTrue); |
| 4441 expect(StringUtilities.isTagName("ab"), isTrue); | 4441 expect(StringUtilities.isTagName("ab"), isTrue); |
| 4442 expect(StringUtilities.isTagName("a-b"), isTrue); | 4442 expect(StringUtilities.isTagName("a-b"), isTrue); |
| 4443 } | 4443 } |
| 4444 | 4444 |
| 4445 void test_printListOfQuotedNames_empty() { | 4445 void test_printListOfQuotedNames_empty() { |
| 4446 try { | 4446 try { |
| 4447 StringUtilities.printListOfQuotedNames(new List<String>(0)); | 4447 StringUtilities.printListOfQuotedNames(new List<String>(0)); |
| 4448 fail("Expected IllegalArgumentException"); | 4448 fail("Expected IllegalArgumentException"); |
| 4449 } on IllegalArgumentException catch (exception) { | 4449 } on IllegalArgumentException { |
| 4450 // Expected | 4450 // Expected |
| 4451 } | 4451 } |
| 4452 } | 4452 } |
| 4453 | 4453 |
| 4454 void test_printListOfQuotedNames_five() { | 4454 void test_printListOfQuotedNames_five() { |
| 4455 expect(StringUtilities | 4455 expect(StringUtilities |
| 4456 .printListOfQuotedNames(<String>["a", "b", "c", "d", "e"]), | 4456 .printListOfQuotedNames(<String>["a", "b", "c", "d", "e"]), |
| 4457 "'a', 'b', 'c', 'd' and 'e'"); | 4457 "'a', 'b', 'c', 'd' and 'e'"); |
| 4458 } | 4458 } |
| 4459 | 4459 |
| 4460 void test_printListOfQuotedNames_null() { | 4460 void test_printListOfQuotedNames_null() { |
| 4461 try { | 4461 try { |
| 4462 StringUtilities.printListOfQuotedNames(null); | 4462 StringUtilities.printListOfQuotedNames(null); |
| 4463 fail("Expected IllegalArgumentException"); | 4463 fail("Expected IllegalArgumentException"); |
| 4464 } on IllegalArgumentException catch (exception) { | 4464 } on IllegalArgumentException { |
| 4465 // Expected | 4465 // Expected |
| 4466 } | 4466 } |
| 4467 } | 4467 } |
| 4468 | 4468 |
| 4469 void test_printListOfQuotedNames_one() { | 4469 void test_printListOfQuotedNames_one() { |
| 4470 try { | 4470 try { |
| 4471 StringUtilities.printListOfQuotedNames(<String>["a"]); | 4471 StringUtilities.printListOfQuotedNames(<String>["a"]); |
| 4472 fail("Expected IllegalArgumentException"); | 4472 fail("Expected IllegalArgumentException"); |
| 4473 } on IllegalArgumentException catch (exception) { | 4473 } on IllegalArgumentException { |
| 4474 // Expected | 4474 // Expected |
| 4475 } | 4475 } |
| 4476 } | 4476 } |
| 4477 | 4477 |
| 4478 void test_printListOfQuotedNames_three() { | 4478 void test_printListOfQuotedNames_three() { |
| 4479 expect(StringUtilities.printListOfQuotedNames(<String>["a", "b", "c"]), | 4479 expect(StringUtilities.printListOfQuotedNames(<String>["a", "b", "c"]), |
| 4480 "'a', 'b' and 'c'"); | 4480 "'a', 'b' and 'c'"); |
| 4481 } | 4481 } |
| 4482 | 4482 |
| 4483 void test_printListOfQuotedNames_two() { | 4483 void test_printListOfQuotedNames_two() { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4590 } | 4590 } |
| 4591 | 4591 |
| 4592 void test_get_added() { | 4592 void test_get_added() { |
| 4593 TokenMap tokenMap = new TokenMap(); | 4593 TokenMap tokenMap = new TokenMap(); |
| 4594 Token key = TokenFactory.tokenFromType(TokenType.AT); | 4594 Token key = TokenFactory.tokenFromType(TokenType.AT); |
| 4595 Token value = TokenFactory.tokenFromType(TokenType.AT); | 4595 Token value = TokenFactory.tokenFromType(TokenType.AT); |
| 4596 tokenMap.put(key, value); | 4596 tokenMap.put(key, value); |
| 4597 expect(tokenMap.get(key), same(value)); | 4597 expect(tokenMap.get(key), same(value)); |
| 4598 } | 4598 } |
| 4599 } | 4599 } |
| OLD | NEW |