blob: 5193d4dba20d2f0a24c68e6d881a849af593280c [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:ffigen/ffigen.dart';
import 'package:ffigen/src/config_provider/spec_utils.dart';
import 'package:ffigen/src/strings.dart' as strings;
import 'package:test/test.dart';
import 'package:yaml/yaml.dart' as yaml;
late Library actual, expected;
void main() {
group('compiler_opts_test', () {
test('Compiler Opts', () {
final opts =
'''--option value "in double quotes" 'in single quotes' -tab=separated''';
final list = compilerOptsToList(opts);
'in double quotes',
'in single quotes',
test('Compiler Opts Automatic', () {
final config = Config.fromYaml(yaml.loadYaml('''
${}: 'NativeLibrary'
${strings.description}: 'Compiler Opts Test'
${strings.output}: 'unused'
- 'test/header_parser_tests/comment_markup.h'
${strings.includeCStdLib}: false
''') as yaml.YamlMap);
expect(config.compilerOpts.isEmpty, true);