Skip to content

Commit e51764f

Browse files
committed
Fix some corelib tests.
R=lrn@google.com Review URL: https://codereview.chromium.org//55533002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29757 260f80e4-7a28-3924-810f-c04153c831b5
1 parent 35e9ae5 commit e51764f

File tree

6 files changed

+17
-29
lines changed

6 files changed

+17
-29
lines changed

tests/corelib/collection_to_string_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ populateRandomCollection(int size, bool exact,
241241
if (startIndex - start > MAX_LENGTH - 6) { // Limit - ", ...)".length.
242242
String prefix = stringRep.toString().substring(0, startIndex);
243243
stringRep.clear();
244-
stringRep.add(prefix);
245-
stringRep.add(", ...");
244+
stringRep.write(prefix);
245+
stringRep.write(", ...");
246246
}
247247
}
248248
} else if (stringRep.length - start > MAX_LENGTH - 1) { // 80 - ")".length.

tests/corelib/corelib.status

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,10 @@ list_as_map_test: Pass, Slow # TODO(kasperl): Please triage.
107107
compare_to2_test: Fail # inherited from VM
108108
unicode_test: Fail # inherited from VM
109109

110-
# Library changes
111-
[ $compiler == none || $compiler == dart2js || $compiler == dart2dart ]
112-
map_keys2_test: RuntimeError # Generic types aren't right.
113-
114-
[ $compiler == dart2js ]
115-
map_values2_test: RuntimeError # Generic types aren't right
116-
117-
## Tests failing after merge of experimental library branch.
118110
[ $compiler == dart2js ]
119-
# Tests fail due to bug in generics on constants, issue 6827
120-
iterable_to_list_test: RuntimeError
121-
iterable_to_set_test: RuntimeError
111+
map_values2_test: RuntimeError # Issue 8210
112+
iterable_to_list_test: RuntimeError # Issue 8210
113+
iterable_to_set_test: RuntimeError # Issue 8210
122114

123115
[ $compiler == dart2dart && $minified ]
124116
error_stack_trace1_test: Fail # Fails in minified mode, test depends on method names.
@@ -155,12 +147,8 @@ collection_length_test: Pass, Timeout
155147
collection_to_string_test: Pass, Crash # Issue: 11207
156148

157149
[ $compiler == dartanalyzer || $compiler == dart2analyzer ]
158-
collection_to_string_test: StaticWarning
159-
error_stack_trace_test: StaticWarning
160-
iterable_element_at_test: StaticWarning
161-
iterable_test: StaticWarning
162-
list_map_test: StaticWarning
163-
num_clamp_test: StaticWarning
164-
queue_test: StaticWarning
165-
string_codeunits_test: StaticWarning
166-
string_test: StaticWarning
150+
error_stack_trace_test: StaticWarning, OK # Test generates errors on purpose.
151+
iterable_element_at_test: StaticWarning, OK # Test generates errors on purpose.
152+
num_clamp_test: StaticWarning, OK # Test generates errors on purpose.
153+
queue_test: StaticWarning # Issue 12274.
154+
string_test: StaticWarning, OK # Test generates error on purpose.

tests/corelib/iterable_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import "package:expect/expect.dart";
99

1010
import 'dart:collection';
1111

12-
class MyIterable implements IterableBase {
12+
class MyIterable extends IterableBase {
1313
get iterator => [].iterator;
1414
}
1515

tests/corelib/list_map_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ void testOperations() {
2020
// Function that reverses l and r lists when used to map.
2121
int rev(x) => 11 - x;
2222
// A base list that starts out like l, but isn't const.
23-
Iterable base = l.map((x) => x).toList();
23+
List base = l.map((x) => x).toList();
2424

2525
Iterable reversed = l.map(rev);
2626

tests/corelib/map_keys2_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ main() {
1515
var map6 = new Map<String, bool>();
1616

1717
Expect.isTrue(map1.keys is Iterable<String>);
18-
Expect.isFalse(map1.keys is Iterable<bool>);
18+
Expect.isTrue(map1.keys is Iterable<bool>);
1919

2020
Expect.isTrue(map2.keys is Iterable<String>);
21-
Expect.isFalse(map2.keys is Iterable<bool>);
21+
Expect.isTrue(map2.keys is Iterable<bool>);
2222

2323
Expect.isTrue(map3.keys is Iterable<String>);
24-
Expect.isFalse(map3.keys is Iterable<bool>);
24+
Expect.isTrue(map3.keys is Iterable<bool>);
2525

2626
Expect.isTrue(map4.keys is Iterable<String>);
27-
Expect.isFalse(map4.keys is Iterable<bool>);
27+
Expect.isTrue(map4.keys is Iterable<bool>);
2828

2929
Expect.isTrue(map5.keys is Iterable<String>);
3030
Expect.isFalse(map5.keys is Iterable<bool>);

tests/corelib/string_codeunits_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import "package:expect/expect.dart";
66

77
main() {
88
test(String s) {
9-
Iterable<int> units = s.codeUnits;
9+
List<int> units = s.codeUnits;
1010
List<int> expectedUnits = <int>[];
1111
for (int i = 0; i < s.length; i++) {
1212
expectedUnits.add(s.codeUnitAt(i));

0 commit comments

Comments
 (0)