<commit_before>library samples_test;

import 'dart:io';
import 'package:test/test.dart';
import 'package:csslib/parser.dart';
import 'package:csslib/src/messages.dart';
import 'testing.dart';

const testOptions = const PreprocessorOptions(
    useColors: false,
    checked: false,
    warningsAsErrors: true,
    inputFile: 'memory'
);

void testCSSFile(File cssFile) {
  final errors = <Message>[];
  final css = cssFile.readAsStringSync();
  final stylesheet = parseCss(css, errors: errors, opts: testOptions);

  expect(stylesheet, isNotNull);
  expect(errors, isEmpty, reason: errors.toString());
}

main() {
  var cssDir = new Directory.fromUri(Platform.script.resolve('./examples'));
  for (var element in cssDir.listSync())
    if(element is File && element.uri.pathSegments.last.endsWith('.css')) {

    test(element.uri.pathSegments.last, () => testCSSFile(element));
  }
}<commit_msg>Formatting test file<commit_after>library samples_test;

import 'dart:io';
import 'package:test/test.dart';
import 'package:csslib/parser.dart';
import 'package:csslib/src/messages.dart';
import 'testing.dart';

const testOptions = const PreprocessorOptions(
    useColors: false,
    checked: false,
    warningsAsErrors: true,
    inputFile: 'memory');

void testCSSFile(File cssFile) {
  final errors = <Message>[];
  final css = cssFile.readAsStringSync();
  final stylesheet = parseCss(css, errors: errors, opts: testOptions);

  expect(stylesheet, isNotNull);
  expect(errors, isEmpty, reason: errors.toString());
}

main() {
  var cssDir = new Directory.fromUri(Platform.script.resolve('./examples'));
  for (var element in cssDir.listSync())
    if (element is File && element.uri.pathSegments.last.endsWith('.css')) {
      test(element.uri.pathSegments.last, () => testCSSFile(element));
    }
}
{'fraction_non_alphanumeric': 0.14444444444444443, 'fraction_numerical': 0.0, 'mean_word_length': 5.043624161073826, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6850722', 'n_tokens_mistral': 573, 'n_tokens_neox': 568, 'n_words': 127}