

  function testSet() {
    var v = goog.vec.vec2d.create();
    goog.vec.vec2d.setFromValues(v, 1, 2);
    assertElementsEquals([1, 2], v);

    goog.vec.vec2d.setFromArray(v, [4, 5]);
    assertElementsEquals([4, 5], v);

    var w = goog.vec.vec2d.create();
    goog.vec.vec2d.setFromValues(w, 1, 2);
    assertElementsEquals([1, 2], w);

    goog.vec.vec2d.setFromArray(w, [4, 5]);
    assertElementsEquals([4, 5], w);
  }

  function testAdd() {
    var v0 = goog.vec.vec2d.setFromArray(goog.vec.vec2d.crea