2019-11-19 23:27:20 +01:00
|
|
|
// Copyright 2019 Google Inc. Use of this source code is governed by an
|
|
|
|
// MIT-style license that can be found in the LICENSE file or at
|
|
|
|
// https://opensource.org/licenses/MIT.
|
|
|
|
|
2023-05-19 22:22:44 +02:00
|
|
|
@TestOn('vm')
|
|
|
|
|
2019-11-19 23:27:20 +01:00
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
import 'package:path/path.dart' as p;
|
|
|
|
import 'package:test/test.dart';
|
|
|
|
import 'package:yaml/yaml.dart';
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
group("YAML files are valid:", () {
|
2021-07-29 03:28:00 +02:00
|
|
|
for (var entry in [
|
|
|
|
...Directory.current.listSync(),
|
|
|
|
...Directory("pkg").listSync(recursive: true)
|
|
|
|
]) {
|
2019-11-19 23:27:20 +01:00
|
|
|
if (entry is File &&
|
|
|
|
(entry.path.endsWith(".yaml") || entry.path.endsWith(".yml"))) {
|
|
|
|
test(p.basename(entry.path), () {
|
|
|
|
// Shouldn't throw an error.
|
|
|
|
loadYaml(entry.readAsStringSync());
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|