<commit_before>// Copyright (c) 2014, 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.

library docgen.generate_json_test;

import 'dart:io';

import 'package:path/path.dart' as p;
import 'package:scheduled_test/descriptor.dart' as d;
import 'package:scheduled_test/scheduled_test.dart';
import 'package:unittest/matcher.dart';

import 'util.dart';
import '../lib/docgen.dart' as dg;

void main() {

  setUp(() {
    scheduleTempDir();
  });

  test('json output', () {
    schedule(() {
      var codeDir = getMultiLibraryCodePath();
      expect(FileSystemEntity.isDirectorySync(codeDir), isTrue);
      return dg.docgen([codeDir], out: p.join(d.defaultRoot, 'docs'));
    });

    d.dir('docs', [
        d.matcherFile('index.json', isJsonMap),
        d.matcherFile('index.txt', hasSortedLines),
        d.matcherFile('library_list.json', isJsonMap),
        d.matcherFile('test_lib-bar.C.json', isJsonMap),
        d.matcherFile('test_lib-bar.json', isJsonMap),
        d.matcherFile('test_lib-foo.B.json', isJsonMap),
        d.matcherFile('test_lib-foo.json', isJsonMap),
        d.matcherFile('test_lib.A.json', isJsonMap),
        d.matcherFile('test_lib.B.json', isJsonMap),
        d.matcherFile('test_lib.C.json', isJsonMap),
        d.matcherFile('test_lib.json', isJsonMap),
    ]).validate()
      // TODO(ajohnsen): Remove once the issue is resolved.
      .catchError((e, s) {
        print(e);
        print(s);
        print(d.describe());
        exit(1);
      });

  });
}<commit_msg>Fix just added debug code.<commit_after>// Copyright (c) 2014, 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.

library docgen.generate_json_test;

import 'dart:io';

import 'package:path/path.dart' as p;
import 'package:scheduled_test/descriptor.dart' as d;
import 'package:scheduled_test/scheduled_test.dart';
import 'package:unittest/matcher.dart';

import 'util.dart';
import '../lib/docgen.dart' as dg;

void main() {

  setUp(() {
    scheduleTempDir();
  });

  test('json output', () {
    schedule(() {
      var codeDir = getMultiLibraryCodePath();
      expect(FileSystemEntity.isDirectorySync(codeDir), isTrue);
      return dg.docgen([codeDir], out: p.join(d.defaultRoot, 'docs'));
    });

    d.dir('docs', [
        d.matcherFile('index.json', isJsonMap),
        d.matcherFile('index.txt', hasSortedLines),
        d.matcherFile('library_list.json', isJsonMap),
        d.matcherFile('test_lib-bar.C.json', isJsonMap),
        d.matcherFile('test_lib-bar.json', isJsonMap),
        d.matcherFile('test_lib-foo.B.json', isJsonMap),
        d.matcherFile('test_lib-foo.json', isJsonMap),
        d.matcherFile('test_lib.A.json', isJsonMap),
        d.matcherFile('test_lib.B.json', isJsonMap),
        d.matcherFile('test_lib.C.json', isJsonMap),
        d.matcherFile('test_lib.json', isJsonMap),
    ]).validate()
      // TODO(ajohnsen): Remove once the issue is resolved.
      .catchError((e, s) {
        print(e);
        print(s);
        print(p.join(d.defaultRoot, 'docs'));
        exit(1);
      });

  });
}
{'fraction_non_alphanumeric': 0.15405405405405406, 'fraction_numerical': 0.003003003003003003, 'mean_word_length': 3.2271573604060912, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5700822', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1117, 'n_words': 231}