Skip to content

Commit 25ef5dc

Browse files
author
Dart CI
committed
Version 2.12.0-4.0.dev
Merge commit '65b424b3fd72302709d6507c0d51651d58d520fa' into 'dev'
2 parents fed66f6 + 65b424b commit 25ef5dc

13 files changed

+138
-2
lines changed

PRESUBMIT.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,47 @@ def _CheckLayering(input_api, output_api):
262262
return []
263263

264264

265+
def _CheckTestPlan(input_api, output_api):
266+
"""Run test plan check.
267+
268+
Each change that touches specified directories in the checkout are required
269+
to have TEST= line explaining how this change was validated.
270+
"""
271+
272+
DIRS = [
273+
'runtime/vm',
274+
'runtime/bin',
275+
'runtime/lib',
276+
'runtime/include',
277+
'runtime/observatory',
278+
'runtime/observatory_2',
279+
'runtime/platform',
280+
'pkg/vm',
281+
'sdk/lib/_internal/vm',
282+
]
283+
284+
# Run only if directory was affected.
285+
files = [f.LocalPath() for f in input_api.AffectedFiles()]
286+
affected = filter(lambda dir: any(f.startswith(dir) for f in files), DIRS)
287+
if len(affected) != 0 and input_api.change.tags.get('TEST', '') == '':
288+
return [
289+
output_api.PresubmitError('Change is missing TEST= line',
290+
long_text="""
291+
When changing files in one of the following directories you
292+
must include TEST= line at the end of your change description.
293+
294+
%s
295+
296+
This line is expected to explain in a free form the kind of testing
297+
that was performed to validate effect of the change. For example,
298+
it can list newly added tests or already existing tests which are assumed
299+
to cover the change.
300+
""" % (' '.join(affected)))
301+
]
302+
303+
return []
304+
305+
265306
def _CheckClangTidy(input_api, output_api):
266307
"""Run clang-tidy on VM changes."""
267308

@@ -333,6 +374,7 @@ def _CommonChecks(input_api, output_api):
333374
results.extend(_CheckLayering(input_api, output_api))
334375
results.extend(_CheckClangTidy(input_api, output_api))
335376
results.extend(_CheckTestMatrixValid(input_api, output_api))
377+
results.extend(_CheckTestPlan(input_api, output_api))
336378
results.extend(
337379
input_api.canned_checks.CheckPatchFormatted(input_api, output_api))
338380
return results
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
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.
4+
5+
// @dart = 2.6
6+
7+
test() {
8+
int x = 3;
9+
x?.isEven;
10+
x = null;
11+
}
12+
13+
main() {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
library;
2+
//
3+
// Problems in library:
4+
//
5+
// pkg/front_end/testcases/nnbd/issue42607.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
6+
// // @dart = 2.6
7+
// ^^^^^^^^^^^^^^
8+
//
9+
import self as self;
10+
11+
static method test() → dynamic
12+
;
13+
static method main() → dynamic
14+
;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
library;
2+
//
3+
// Problems in library:
4+
//
5+
// pkg/front_end/testcases/nnbd/issue42607.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
6+
// // @dart = 2.6
7+
// ^^^^^^^^^^^^^^
8+
//
9+
import self as self;
10+
import "dart:core" as core;
11+
12+
static method test() → dynamic {
13+
core::int* x = 3;
14+
let final core::int* #t1 = x in #t1.{core::num::==}(null) ?{core::bool*} null : #t1.{core::int::isEven};
15+
x = null;
16+
}
17+
static method main() → dynamic {}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
library;
2+
//
3+
// Problems in library:
4+
//
5+
// pkg/front_end/testcases/nnbd/issue42607.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety.
6+
// // @dart = 2.6
7+
// ^^^^^^^^^^^^^^
8+
//
9+
import self as self;
10+
import "dart:core" as core;
11+
12+
static method test() → dynamic {
13+
core::int* x = 3;
14+
let final core::int* #t1 = x in #t1.{core::num::==}(null) ?{core::bool*} null : #t1.{core::int::isEven};
15+
x = null;
16+
}
17+
static method main() → dynamic {}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// @dart = 2.6
2+
test() {}
3+
main() {}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// @dart = 2.6
2+
main() {}
3+
test() {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
library;
2+
import self as self;
3+
import "dart:core" as core;
4+
5+
static method test() → dynamic {
6+
core::int* x = 3;
7+
let final core::int* #t1 = x in #t1.{core::num::==}(null) ?{core::bool*} null : #t1.{core::int::isEven};
8+
x = null;
9+
}
10+
static method main() → dynamic {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
library;
2+
import self as self;
3+
import "dart:core" as core;
4+
5+
static method test() → dynamic {
6+
core::int* x = 3;
7+
let final core::int* #t1 = x in #t1.{core::num::==}(null) ?{core::bool*} null : #t1.{core::int::isEven};
8+
x = null;
9+
}
10+
static method main() → dynamic {}

sdk/lib/core/list.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ abstract class List<E> implements EfficientLengthIterable<E> {
337337
* Increasing the length fails if the element type does not allow `null`.
338338
*
339339
* Throws an [UnsupportedError] if the list is fixed-length or
340-
* if attempting tp enlarge the list when `null` is not a valid element.
340+
* if attempting to enlarge the list when `null` is not a valid element.
341341
*/
342342
set length(int newLength);
343343

0 commit comments

Comments
 (0)