function assertRangesEqual(a, b, c = undefined) {
  const message = c ? a : '';
  let expected = c ? b : a;
  const actual = c ? c : b;

  if (Array.isArray(expected)) {
    assertEquals(
        `${message}
` +
            'Expected ranges must be specified as goog.math.Range ' +
            'objects or as 2-element number arrays. Found [' +
            expected.join(', ') + ']',
        2, expected.length);
    expected = new Range(expected[0], expected[1]);
  }

  if (!Range.equals(
          /** @type {!Range} */ (expected),
          /** @type {!Range} */ (actual))) {
    if (message) {
      assertEquals(message, expected, actual);
    } else {
      assertEquals(expected, actual);
    }
  }
}
Produce legible assertion results for comparing ranges. The expected range
may be defined as a Range or as a two-element array of numbers. If
two ranges are not equal, the error message will be in the format:
"Expected <[1, 2]> (Object) but was <[3, 4]> (Object)"
@param {!Range|!Array<number>|string} a A descriptive string or the expected
    range.
@param {!Range|!Array<number>} b The expected range when a descriptive string
    is present, or the range to compare.
@param {Range=} c The range to compare when a descriptive string is present.