<commit_before>// Copyright (c) 2013, Google Inc. 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 spark.ace_test;

import 'dart:async';
import 'dart:html';

import 'package:ace/ace.dart' as ace;
import 'package:unittest/unittest.dart';

import '../lib/ace.dart';
import '../lib/workspace.dart' as workspace;

defineTests() {
  group('ace', () {
    // This essentially tests that the ace codebase is available.
    test('is available', () {
      expect(AceContainer.available, true);
    });
  });
}

class MockAceContainer implements AceContainer {
  /// The element to put the editor in.
  final Element parentElement = null;
  workspace.File currentFile = null;

  MockAceContainer();

  EditSession createEditSession(String text, String fileName) {
    return new MockEditSession(fileName);
  }

  Point get cursorPosition => new Point(0, 0);
  void set cursorPosition(Point position) {}
  ace.EditSession get currentSession => null;
  void focus() { }
  void resize() { }
  void setTheme(String theme) { }
  void switchTo(EditSession session, [workspace.File file]) { }
  set theme(String value) { }
  String get theme => null;
  Future<String> getKeyBinding() => new Future.value(null);
  void setKeyBinding(String name) { }
  void setMarkers(List<workspace.Marker> markers) { }
  void clearMarkers() { }
}

class MockAceEditor implements AceEditor {
  AceContainer aceContainer;
  workspace.File file;

  MockAceEditor([this.aceContainer]);

  Element get element => aceContainer.parentElement;
<commit_msg>Added missing method to mock<commit_after>// Copyright (c) 2013, Google Inc. 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 spark.ace_test;

import 'dart:async';
import 'dart:html';

import 'package:ace/ace.dart' as ace;
import 'package:unittest/unittest.dart';

import '../lib/ace.dart';
import '../lib/workspace.dart' as workspace;

defineTests() {
  group('ace', () {
    // This essentially tests that the ace codebase is available.
    test('is available', () {
      expect(AceContainer.available, true);
    });
  });
}

class MockAceContainer implements AceContainer {
  /// The element to put the editor in.
  final Element parentElement = null;
  workspace.File currentFile = null;

  MockAceContainer();

  EditSession createEditSession(String text, String fileName) {
    return new MockEditSession(fileName);
  }

  Point get cursorPosition => new Point(0, 0);
  void set cursorPosition(Point position) {}
  ace.EditSession get currentSession => null;
  void focus() { }
  void resize() { }
  void setTheme(String theme) { }
  void switchTo(EditSession session, [workspace.File file]) { }
  set theme(String value) { }
  String get theme => null;
  Future<String> getKeyBinding() => new Future.value(null);
  void setKeyBinding(String name) { }
  void setMarkers(List<workspace.Marker> markers) { }
  void clearMarkers() { }
  void recreateMiniMap() { }
}

class MockAceEditor implements AceEditor {
  AceContainer aceContainer;
  workspace.File file;

  MockAceEditor([this.aceContainer]);

  Element get element => aceContainer.parentElement;

{'fraction_non_alphanumeric': 0.11478365384615384, 'fraction_numerical': 0.003605769230769231, 'mean_word_length': 4.113671274961598, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '5494161', 'n_tokens_mistral': 1004, 'n_tokens_neox': 982, 'n_words': 312}