Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Side by Side Diff: test/backend/platform_selector/evaluate_test.dart

Issue 1027193004: Respect top-level @TestOn declarations. (Closed) Base URL: git@github.com:dart-lang/unittest@master
Patch Set: Add another test. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 @TestOn("vm")
6
5 import 'dart:io'; 7 import 'dart:io';
6 8
7 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
8 import 'package:unittest/src/backend/operating_system.dart'; 10 import 'package:unittest/src/backend/operating_system.dart';
9 import 'package:unittest/src/backend/platform_selector.dart'; 11 import 'package:unittest/src/backend/platform_selector.dart';
10 import 'package:unittest/src/backend/test_platform.dart'; 12 import 'package:unittest/src/backend/test_platform.dart';
11 13
12 void main() { 14 void main() {
13 test("new PlatformSelector.parse() disallows invalid variables", () { 15 test("new PlatformSelector.parse() disallows invalid variables", () {
14 expect(() => new PlatformSelector.parse("undefined"), 16 expect(() => new PlatformSelector.parse("undefined"),
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 /// Returns the result of evaluating [expression] on [platform] and [os]. 133 /// Returns the result of evaluating [expression] on [platform] and [os].
132 /// 134 ///
133 /// [platform] defaults to [TestPlatform.vm]; [os] defaults to the current 135 /// [platform] defaults to [TestPlatform.vm]; [os] defaults to the current
134 /// operating system. 136 /// operating system.
135 bool _eval(String expression, {TestPlatform platform, OperatingSystem os}) { 137 bool _eval(String expression, {TestPlatform platform, OperatingSystem os}) {
136 if (platform == null) platform = TestPlatform.vm; 138 if (platform == null) platform = TestPlatform.vm;
137 if (os == null) os = OperatingSystem.findByIoName(Platform.operatingSystem); 139 if (os == null) os = OperatingSystem.findByIoName(Platform.operatingSystem);
138 var selector = new PlatformSelector.parse(expression); 140 var selector = new PlatformSelector.parse(expression);
139 return selector.evaluate(platform, os: os); 141 return selector.evaluate(platform, os: os);
140 } 142 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698