blob: 906b476c4ec4c1ecb9cfe41f9731bb9af90c79b6 [file] [log] [blame]
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:baseline/options.dart';
import 'package:test/test.dart';
const _builders = ['-ba1,a2', '-tb'];
main() {
for (var channels in [
['main'],
['dev', 'beta'],
['stable'],
]) {
var arguments = ['-c${channels.join(',')}', ..._builders];
test('channels: "$arguments"', () {
var options = BaselineOptions(arguments);
expect(options.channels, channels);
});
}
test('builder-mapping', () {
var options = BaselineOptions(_builders);
expect(options.builders, ['a1', 'a2']);
expect(options.target, 'b');
});
test('config-mapping', () {
var options = BaselineOptions(['-mc:d,e:f', ..._builders]);
expect(options.configs, {'c': 'd', 'e': 'f'});
});
test('dry-run defaults to false', () {
var options = BaselineOptions(_builders);
expect(options.dryRun, false);
});
test('dry-run: true', () {
var options = BaselineOptions(['-n', ..._builders]);
expect(options.dryRun, true);
});
}