AutoComplete icon indicating copy to clipboard operation
AutoComplete copied to clipboard

Circular comparison order in FunctionCompletion

Open tttwang23 opened this issue 9 years ago • 1 comments

Test case:

	@Test
	public void testCompletionOrdering1()
	{
		DefaultCompletionProvider provider = new DefaultCompletionProvider();
		final Completion c1 = new FunctionCompletion(provider, "add", "int");
		final Completion c2 = new VariableCompletion(provider, "indx", "int");
		final Completion c3 = new FunctionCompletion(provider, "Sub", "int");
		Assert.assertTrue(c1.compareTo(c2) < 0);
		Assert.assertTrue(c2.compareTo(c3) < 0);
		// (c1 < c2) and (c2 < c3), then it is implied that (c1 < c3)
		Assert.assertTrue(c1.compareTo(c3) < 0);
	}

tttwang23 avatar Nov 17 '16 17:11 tttwang23

Fixed in the pull request.

tttwang23 avatar Nov 17 '16 18:11 tttwang23