Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
omgm opened this issue Aug 18, 2014 · 0 comments
Open

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

omgm opened this issue Aug 18, 2014 · 0 comments

Comments

@omgm
Copy link

omgm commented Aug 18, 2014

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).
  })
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant