<commit_before>// Copyright (c) 2016, <NAME>. All rights reserved.
// Use of this source code is governed by an AGPL-3.0-style license
// that can be found in the LICENSE file.

import 'package:test/test.dart';
import 'package:quiver/core.dart';
import 'package:eqlib/eqlib.dart';
import 'package:eqlib/inline.dart';

void main() {
  final a = symbol('a'), b = symbol('b');

  test('Eq.hashCode', () {
    expect(new Eq.parse('100=100').hashCode,
        equals(hash2(hash2(0, 100), hash2(0, 100))));
    expect(new Eq.parse('a * b = b * a').hashCode,
        equals(eq(a * b, b * a).hashCode));
  });

  test('Expr.from', () {
    expect(new Expr.from(new SymbolExpr(100)), equals(new SymbolExpr(100)));
    expect(new Expr.from(100), equals(new NumberExpr(100)));
    expect(() => new Expr.from('a'), throwsArgumentError);
  });
}
<commit_msg>Use eqlibThrows in tests<commit_after>// Copyright (c) 2016, <NAME>. All rights reserved.
// Use of this source code is governed by an AGPL-3.0-style license
// that can be found in the LICENSE file.

import 'package:test/test.dart';
import 'package:quiver/core.dart';
import 'package:eqlib/eqlib.dart';
import 'package:eqlib/inline.dart';
import 'package:eqlib/exceptions.dart';

void main() {
  final a = symbol('a'), b = symbol('b');

  test('Eq.hashCode', () {
    expect(new Eq.parse('100=100').hashCode,
        equals(hash2(hash2(0, 100), hash2(0, 100))));
    expect(new Eq.parse('a * b = b * a').hashCode,
        equals(eq(a * b, b * a).hashCode));
  });

  test('Expr.from', () {
    expect(new Expr.from(new SymbolExpr(100)), equals(new SymbolExpr(100)));
    expect(new Expr.from(100), equals(new NumberExpr(100)));
    expect(() => new Expr.from('a'), throwsArgumentError);
  });

  test('EqLibException', () {
    expect(() => eq(1, 1).wrap(number(2), number(2)),
        eqlibThrows('the condition does not match left or right'));
  });
}

{'fraction_non_alphanumeric': 0.19105263157894736, 'fraction_numerical': 0.03894736842105263, 'mean_word_length': 3.9634464751958225, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '468948', 'n_tokens_mistral': 709, 'n_tokens_neox': 656, 'n_words': 162}