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

get returns reference to inner array #9

Open
mrstux opened this issue Jul 5, 2018 · 1 comment
Open

get returns reference to inner array #9

mrstux opened this issue Jul 5, 2018 · 1 comment

Comments

@mrstux
Copy link

mrstux commented Jul 5, 2018

This is perhaps expected, but is it correct?

	it( 'results of prevous get should not be modified by future set', () => {
		let map = new Multimap( [['a',1]]);
		
		let aList = map.get('a');
		assert.strictEqual(aList.length, 1);
		
		map.set('a', 2);
		
		// aList.length is now 2
		assert.strictEqual(aList.length, 1);
	});
@mrstux mrstux closed this as completed Jul 5, 2018
@mrstux mrstux reopened this Jul 5, 2018
@KoryNunn
Copy link
Collaborator

Hey @mrstux, I think this is a reasonable test, would you be able to add it and do a PR?

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

2 participants