assertPathEquals = (expected, path) => {
  const actual = [];
  path.forEachSegment((seg, args) => {
    actual.push(SEGMENT_NAMES[seg]);
    Array.prototype.push.apply(actual, args);
  });
  assertEquals(expected.length, actual.length);
  for (let i = 0; i < expected.length; i++) {
    if (typeof expected[i] === 'number') {
      assertTrue(typeof actual[i] === 'number');
      assertRoughlyEquals(expected[i], actual[i], 0.01);
    } else {
      assertEquals(expected[i], actual[i]);
    }
  }
}
Test if the given path matches the expected array of commands and parameters.
@param {Array<string|number>} expected The expected array of commands and
    parameters.
@param {Path} path The path to test against.