blob: ac971b9d5c3413fa455e993b365316e5fb03ec80 [file] [log] [blame]
// Copyright (c) 2023, 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.
@TestOn('vm')
library;
import 'dart:io';
import 'package:firehose/src/health/license.dart';
import 'package:path/path.dart' as path;
import 'package:test/test.dart';
void main() {
var fileWithLicense = File('test/fileWithLicense.dart');
var fileWithoutLicense = File('test/fileWithoutLicense.dart');
setUp(() async {
await fileWithLicense.writeAsString(license);
await fileWithoutLicense.writeAsString('');
});
test('Check for licenses', () async {
var directory = Directory('test/');
var filesWithoutLicenses = await getFilesWithoutLicenses(directory, []);
expect(filesWithoutLicenses,
[path.relative(fileWithoutLicense.path, from: directory.path)]);
});
tearDown(() async {
await fileWithLicense.delete();
await fileWithoutLicense.delete();
});
}