anchor.diff:        if (start < 0) start = 0;
         if (end > string.length) end = string.length;
       }
  -    if (start == 0 && end == string.length) return string;
       StringBuffer buf = new StringBuffer();
       if (start > 0) buf.write("...");
  +    _escapeSubstring(buf, string, 0, string.length);
  +    if (end < string.length) buf.write("...");
  +    return buf.toString();
  +  }
  +
  +  /// Return the string with characters that are not printable ASCII characters
  +  /// escaped as either "\xXX" codes or "\uXXXX" codes.
  +  static String _escapeString(String string) {
  +    StringBuffer buf = new StringBuffer();
  +    _escapeSubstring(buf, string, 0, string.length);
  +    return buf.toString();
  +  }
  +
  +  static _escapeSubstring(StringBuffer buf, String string, int start, int end) {
  +    const hexDigits = "0123456789ABCDEF";
       for (int i = start; i < end; i++) {
         int code = string.codeUnitAt(i);
  -      if (code < 0x20) {
  +      if (0x20 <= code && code < 0x7F) {
  +        if (code == 0x5C) {
  +          buf.write(r"\\");
  +        } else {
  +          buf.writeCharCode(code);
  +        }
  +      } else if (code < 0x100) {
           buf.write(r"\x");
  -        buf.write("0123456789abcdef"[code ~/ 16]);
  -        buf.write("0123456789abcdef"[code % 16]);
  +        buf.write(hexDigits[code >> 4]);
  +        buf.write(hexDigits[code & 15]);
         } else {
  -        buf.writeCharCode(string.codeUnitAt(i));
  -      }
  -    }
  -    if (end < string.length) buf.write("...");
  -    return buf.toString();
  +        buf.write(r"\u{");
  +        buf.write(code.toRadixString(16).toUpperCase());
  +        buf.write(r"}");
  +      }
  +    }
     }
   
     /**
  
positive.code:       if (stringDifference != null) {
          _fail("Expect.equals($stringDifference$msg) fails.");
        }
      }
      _fail("Expect.equals(expected: <$expected>, actual: <$actual>$msg) fails.");
    }
  
negative.code:   static void identical(var expected, var actual, [String reason = null]) {
      if (_identical(expected, actual)) return;
      String msg = _getMessage(reason);
      if (expected is String && actual is String) {
        String note =
            (expected == actual) ? ' Strings equal but not identical.' : '';
        _fail("Expect.identical(expected: <${_escapeString(expected)}>"
            ", actual: <${_escapeString(actual)}>$msg) "
            "fails.$note");
      }
      _fail("Expect.identical(expected: <$expected>, actual: <$actual>$msg) "
          "fails.");
    }
  