anchor.diff:    p.length2 = 17;
     p.diffs = [new Diff(DIFF_EQUAL, 'jump'), new Diff(DIFF_DELETE, 's'), new Diff(DIFF_INSERT, 'ed'), new Diff(DIFF_EQUAL, ' over '), new Diff(DIFF_DELETE, 'the'), new Diff(DIFF_INSERT, 'a'), new Diff(DIFF_EQUAL, '\nlaz')];
     String strp = '@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n  over \n-the\n+a\n %0Alaz\n';
  -  Expect.equals(strp, p.toString(), 'Patch: toString.');
  +  expect(strp, p.toString(), reason: 'Patch: toString.');
   }
   
   void testPatchFromText() {
     Expect.isTrue(dmp.patch_fromText('').isEmpty, 'patch_fromText: #0.');
   
     String strp = '@@ -21,18 +22,17 @@\n jump\n-s\n+ed\n  over \n-the\n+a\n %0Alaz\n';
  -  Expect.equals(strp, dmp.patch_fromText(strp)[0].toString(), 'patch_fromText: #1.');
  -
  -  Expect.equals('@@ -1 +1 @@\n-a\n+b\n', dmp.patch_fromText('@@ -1 +1 @@\n-a\n+b\n')[0].toString(), 'patch_fromText: #2.');
  -
  -  Expect.equals('@@ -1,3 +0,0 @@\n-abc\n', dmp.patch_fromText('@@ -1,3 +0,0 @@\n-abc\n')[0].toString(), 'patch_fromText: #3.');
  -
  -  Expect.equals('@@ -0,0 +1,3 @@\n+abc\n', dmp.patch_fromText('@@ -0,0 +1,3 @@\n+abc\n')[0].toString(), 'patch_fromText: #4.');
  +  expect(strp, dmp.patch_fromText(strp)[0].toString(), reason: 'patch_fromText: #1.');
  +
  +  expect('@@ -1 +1 @@\n-a\n+b\n', dmp.patch_fromText('@@ -1 +1 @@\n-a\n+b\n')[0].toString(), reason: 'patch_fromText: #2.');
  +
  +  expect('@@ -1,3 +0,0 @@\n-abc\n', dmp.patch_fromText('@@ -1,3 +0,0 @@\n-abc\n')[0].toString(), reason: 'patch_fromText: #3.');
  +
  +  expect('@@ -0,0 +1,3 @@\n+abc\n', dmp.patch_fromText('@@ -0,0 +1,3 @@\n+abc\n')[0].toString(), reason: 'patch_fromText: #4.');
   
     // Generates error.
     Expect.throws(() => dmp.patch_fromText('Bad\nPatch\n'), null, 'patch_fromText: #5.');
  
positive.code:   void assertMapEquals(Map a, Map b, String error_msg) {
      Expect.setEquals(a.keys, b.keys, error_msg);
      for (var x in a.keys) {
        Expect.equals(a[x], b[x], "$error_msg [Key: $x]");
      }
    }
  
  
negative.code:   // Bitap algorithm.
    dmp.Match_Distance = 100;
    dmp.Match_Threshold = 0.5;
    expect(5, dmp._match_bitap('abcdefghijk', 'fgh', 5), reason: 'match_bitap: Exact match #1.');
  
    expect(5, dmp._match_bitap('abcdefghijk', 'fgh', 0), reason: 'match_bitap: Exact match #2.');
  
    expect(4, dmp._match_bitap('abcdefghijk', 'efxhi', 0), reason: 'match_bitap: Fuzzy match #1.');
  
    expect(2, dmp._match_bitap('abcdefghijk', 'cdefxyhijk', 5), reason: 'match_bitap: Fuzzy match #2.');
  
    expect(-1, dmp._match_bitap('abcdefghijk', 'bxy', 1), reason: 'match_bitap: Fuzzy match #3.');
  
    expect(2, dmp._match_bitap('123456789xx0', '3456789x0', 2), reason: 'match_bitap: Overflow.');
  
    expect(0, dmp._match_bitap('abcdef', 'xxabc', 4), reason: 'match_bitap: Before start match.');
  
    expect(3, dmp._match_bitap('abcdef', 'defyy', 4), reason: 'match_bitap: Beyond end match.');
  
    expect(0, dmp._match_bitap('abcdef', 'xabcdefy', 0), reason: 'match_bitap: Oversized pattern.');
  
    dmp.Match_Threshold = 0.4;
    expect(4, dmp._match_bitap('abcdefghijk', 'efxyhi', 1), reason: 'match_bitap: Threshold #1.');
  
    dmp.Match_Threshold = 0.3;
    expect(-1, dmp._match_bitap('abcdefghijk', 'efxyhi', 1), reason: 'match_bitap: Threshold #2.');
  
    dmp.Match_Threshold = 0.0;
    expect(1, dmp._match_bitap('abcdefghijk', 'bcdef', 1), reason: 'match_bitap: Threshold #3.');
  
    dmp.Match_Threshold = 0.5;
    expect(0, dmp._match_bitap('abcdexyzabcde', 'abccde', 3), reason: 'match_bitap: Multiple select #1.');
  
    expect(8, dmp._match_bitap('abcdexyzabcde', 'abccde', 5), reason: 'match_bitap: Multiple select #2.');
  
    dmp.Match_Distance = 10;  // Strict location.
    expect(-1, dmp._match_bitap('abcdefghijklmnopqrstuvwxyz', 'abcdefg', 24), reason: 'match_bitap: Distance test #1.');
  
    expect(0, dmp._match_bitap('abcdefghijklmnopqrstuvwxyz', 'abcdxxefg', 1), reason: 'match_bitap: Distance test #2.');
  
    dmp.Match_Distance = 1000;  // Loose location.
    expect(0, dmp._match_bitap('abcdefghijklmnopqrstuvwxyz', 'abcdefg', 24), reason: 'match_bitap: Distance test #3.');
  }
  
  void testMatchMain() {
    // Full match.
    expect(0, dmp.match_main('abcdef', 'abcdef', 1000), reason: 'match_main: Equality.');
  
    expect(-1, dmp.match_main('', 'abcdef', 1), reason: 'match_main: Null text.');
  
    expect(3, dmp.match_main('abcdef', '', 3), reason: 'match_main: Null pattern.');
  
    expect(3, dmp.match_main('abcdef', 'de', 3), reason: 'match_main: Exact match.');
  
    expect(3, dmp.match_main('abcdef', 'defy', 4), reason: 'match_main: Beyond end match.');
  
    expect(0, dmp.match_main('abcdef', 'abcdefy', 0), reason: 'match_main: Oversized pattern.');
  
    dmp.Match_Threshold = 0.7;
    expect(4, dmp.match_main('I am the very model of a modern major general.', ' that berry ', 5), reason: 'match_main: Complex match.');
    dmp.Match_Threshold = 0.5;
  
    // Test null inputs.
  