Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ui] Add test on auto-completion after new keyword.
see #637 Signed-off-by: Stéphane Galland <galland@arakhne.org>
- Loading branch information
1 parent
5678813
commit e36c5ac
Showing
2 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
tests/io.sarl.lang.ui.tests/src/io/sarl/lang/ui/tests/bugs/Bug637.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters