Skip to content
Snippets Groups Projects
Commit 71a42aa2 authored by Natalie Weizenbaum's avatar Natalie Weizenbaum Committed by GitHub
Browse files

Fix a Metadata bug. (#504)

Closes #503
parent cccb660c
No related branches found
Tags 0.12.17+3
No related merge requests found
## 0.12.17+1
* Fix a bug where tags couldn't be marked as skipped.
## 0.12.17
* Deprecate `expectAsync` and `expectAsyncUntil`, since they currently can't be
......
......@@ -262,8 +262,8 @@ class Metadata {
new Metadata(
testOn: testOn.intersection(other.testOn),
timeout: timeout.merge(other.timeout),
skip: other._skip ?? _skip ,
skipReason: other.skipReason == null ? skipReason : other.skipReason,
skip: other._skip ?? _skip,
skipReason: other.skipReason ?? skipReason,
verboseTrace: other._verboseTrace ?? _verboseTrace,
tags: tags.union(other.tags),
onPlatform: mergeMaps(onPlatform, other.onPlatform,
......@@ -319,9 +319,9 @@ class Metadata {
return {
'testOn': testOn == PlatformSelector.all ? null : testOn.toString(),
'timeout': _serializeTimeout(timeout),
'skip': skip,
'skip': _skip,
'skipReason': skipReason,
'verboseTrace': verboseTrace,
'verboseTrace': _verboseTrace,
'tags': tags.toList(),
'onPlatform': serializedOnPlatform,
'forTag': mapMap(forTag,
......
name: test
version: 0.12.17
version: 0.12.17+1
author: Dart Team <misc@dartlang.org>
description: A library for writing dart unit tests.
homepage: https://github.com/dart-lang/test
......
......@@ -132,6 +132,30 @@ void main() {
test.stdout.expect(consumeThrough(contains("+1: All tests passed!")));
test.shouldExit(0);
});
// Regression test for #503.
test("skips tests whose tags are marked as skip", () {
d.file("dart_test.yaml", JSON.encode({
"tags": {"foo": {"skip": "some reason"}}
})).create();
d.file("test.dart", """
import 'dart:async';
import 'package:test/test.dart';
void main() {
test("test 1", () => throw 'bad', tags: ['foo']);
}
""").create();
var test = runTest(["test.dart"]);
test.stdout.expect(containsInOrder([
"some reason",
"All tests skipped."
]));
test.shouldExit(0);
});
});
group("include_tags and exclude_tags", () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment