Skip to content

moveTo() does not seem to persist the changes to the object #19

@omgm

Description

@omgm

This issue was found while performing mutation analysis on the the test suite vector-test.js.

Even though vector.js' moveTo() appears to be applicative and it should save the changes to the caller object (via "this.x", et cetera), the changes do not seem to persist as the following (new) test shows:

describe('One vector: ', function () {
  it('is moved to another position', function () {  // is converted into another?
    var x = new v(1,0,0);
    var y = new v(1,1,0);
    var c = x.distanceFrom(y);
    c.should.eql(1);
    x.moveTo(y);
    var c = x.distanceFrom(y);
    c.should.eql(0);            // <--- fails here because x.distanceFrom(y) returns 1 (one).
  })
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions