Skip to content

Commit

Permalink
[ui] Add test on auto-completion after new keyword.
Browse files Browse the repository at this point in the history
see #637

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Apr 6, 2017
1 parent 5678813 commit e36c5ac
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
@@ -0,0 +1,69 @@
/*
* Copyright (C) 2014-2017 the original authors or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.sarl.lang.ui.tests.bugs;

import org.junit.Test;

import io.sarl.lang.ui.tests.contentassist.AbstractContentAssistTest;

/** Issue: Product Panic when auto-completing.
*
* @author $Author: sgalland$
* @version $FullVersion$
* @mavengroupid $GroupId$
* @mavenartifactid $ArtifactId$
* @see "https://github.com/sarl/sarl/issues/637"
*/
@SuppressWarnings("all")
public class Bug637 extends AbstractContentAssistTest {

@Override
protected String getPrefix() {
return multilineString(
"package fr.utbm.info.ia51.labwork2.environment",
"",
"import java.lang.ref.WeakReference",
"import fr.utbm.info.ia51.framework.math.Rectangle2f",
"",
"/**",
"* @author apette",
"*",
"*/",
"class TreeNode {",
"",
"val parent : WeakReference<TreeNode>",
"",
"var children : TreeNode[]",
"",
"new (parent : TreeNode, box : Rectangle2f)",
"{",
"this.parent = new ");
}

@Override
protected String getSuffix() {
return multilineString(
"",
"}",
"}"
);
}
@Test
public void completionAfterNewKeyword() throws Exception {
assertTextInsideProposals(newBuilder(), "TreeNode");
}

}
Expand Up @@ -186,7 +186,7 @@ protected static ContentAssistProcessorTestBuilder assertNoText(ContentAssistPro
return builder;
}

/** Assert that all the given texts are not in the proposal.
/** Assert that all the given texts are in the proposal.
*
* <p>In opposite to {@link ContentAssistProcessorTestBuilder#assertText(String...)}, this function
* is not failing if the more text than the given ones are proposed.
Expand Down

0 comments on commit e36c5ac

Please sign in to comment.