<commit_before>// Copyright (c) 2012, 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('args_test');

#import('../../unittest/unittest.dart');

// TODO(rnystrom): Use "package:" URL here when test.dart can handle pub.
#import('../lib/args.dart');

main() {
  group('ArgParser.addFlag()', () {
    test('throws ArgumentError if the flag already exists', () {
      var parser = new ArgParser();
      parser.addFlag('foo');
      throwsIllegalArg(() => parser.addFlag('foo'));
    });

    test('throws ArgumentError if the option already exists', () {
      var parser = new ArgParser();
      parser.addOption('foo');<commit_msg>Restructure pkg/unittest and pkg/webdriver to follow the pub conventions. This means all imports of unittest in our test code had to change to include 'lib' in the path. While doing that change I changed the library/imports to the new syntax in the affected files. Review URL: https://codereview.chromium.org//11301046<commit_after>// Copyright (c) 2012, 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 args_test;

import '../../../pkg/unittest/lib/unittest.dart';

// TODO(rnystrom): Use "package:" URL here when test.dart can handle pub.
import '../lib/args.dart';

main() {
  group('ArgParser.addFlag()', () {
    test('throws ArgumentError if the flag already exists', () {
      var parser = new ArgParser();
      parser.addFlag('foo');
      throwsIllegalArg(() => parser.addFlag('foo'));
    });

    test('throws ArgumentError if the option already exists', () {
      var parser = new ArgParser();
      parser.addOption('foo');
{'fraction_non_alphanumeric': 0.13326226012793177, 'fraction_numerical': 0.008528784648187633, 'mean_word_length': 3.5447941888619856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '71371', 'n_tokens_mistral': 542, 'n_tokens_neox': 519, 'n_words': 204}