<commit_before><commit_msg>Fix Rect intersection; add test<commit_after>import 'dart:sky';

import 'package:test/test.dart';

void main() {
  test("rect accessors", () {
    Rect r = new Rect.fromLTRB(1.0, 3.0, 5.0, 7.0);
    expect(r.left, equals(1.0));
    expect(r.top, equals(3.0));
    expect(r.right, equals(5.0));
    expect(r.bottom, equals(7.0));
  });

  test("rect created by width and height", () {
    Rect r = new Rect.fromLTWH(1.0, 3.0, 5.0, 7.0);
    expect(r.left, equals(1.0));
    expect(r.top, equals(3.0));
    expect(r.right, equals(6.0));
    expect(r.bottom, equals(10.0));
  });

  test("rect intersection", () {
    Rect r1 = new Rect.fromLTRB(0.0, 0.0, 100.0, 100.0);
    Rect r2 = new Rect.fromLTRB(50.0, 50.0, 200.0, 200.0);
    Rect r3 = r1.intersect(r2);
    expect(r3.left, equals(50.0));
    expect(r3.top, equals(50.0));
    expect(r3.right, equals(100.0));
    expect(r3.bottom, equals(100.0));
    Rect r4 = r2.intersect(r1);
    expect(r4, equals(r3));
  });
}

{'fraction_non_alphanumeric': 0.21142284569138275, 'fraction_numerical': 0.0871743486973948, 'mean_word_length': 3.197478991596639, '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': '5037969', 'n_tokens_mistral': 453, 'n_tokens_neox': 421, 'n_words': 80}