This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #705 from eclipse/cd_someMoreX2Jb
[eclipse-xtext/xtext#1952] converting test code to java
- Loading branch information
Showing
8 changed files
with
1,927 additions
and
4,750 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
source.. = src/,\ | ||
xtend-gen/,\ | ||
longrunning/src/,\ | ||
suites/,\ | ||
smoke-suites/ | ||
|
60 changes: 60 additions & 0 deletions
60
...t.xbase.tests/src/org/eclipse/xtext/xbase/tests/formatting/XbaseCommentFormatterTest.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,60 @@ | ||
/** | ||
* Copyright (c) 2012, 2021 itemis AG (http://www.itemis.eu) and others. | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.eclipse.xtext.xbase.tests.formatting; | ||
|
||
import org.eclipse.xtext.testing.InjectWith; | ||
import org.eclipse.xtext.testing.XtextRunner; | ||
import org.eclipse.xtext.testing.formatter.FormatterTestRequest; | ||
import org.eclipse.xtext.util.Strings; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import com.google.inject.Inject; | ||
|
||
@RunWith(XtextRunner.class) | ||
@InjectWith(XbaseFormatterTestInjectorProvider.class) | ||
public class XbaseCommentFormatterTest { | ||
@Inject | ||
private XbaseFormatterTester xbaseFormatterTester; | ||
|
||
@Test | ||
public void commentInIfExpression() { | ||
xbaseFormatterTester.assertFormattedExpression((FormatterTestRequest it) -> { | ||
String model = | ||
"if (true)\n" + | ||
" println(\"foo\")\n" + | ||
"else // if (true)\n" + | ||
" println(\"bar\")\n" + | ||
"println(\"end\")\n"; | ||
it.setToBeFormatted(Strings.toPlatformLineSeparator(model)); | ||
}); | ||
} | ||
|
||
@Test | ||
public void commentAfterForExpression1() { | ||
xbaseFormatterTester.assertFormattedExpression((FormatterTestRequest it) -> { | ||
String model = | ||
"for (f : #[])\n" + | ||
" if (1 < 2) {\n" + | ||
" }\n" + | ||
"\n" + | ||
"// foo\n" + | ||
"var lastOffset = \"\"\n"; | ||
it.setToBeFormatted(Strings.toPlatformLineSeparator(model)); | ||
}); | ||
} | ||
|
||
@Test | ||
public void commentAfterForExpression3() { | ||
xbaseFormatterTester.assertFormattedExpression((FormatterTestRequest it) -> { | ||
String model = "val ll = #[].map(e|e.toString) // error here\n"; | ||
it.setToBeFormatted(Strings.toPlatformLineSeparator(model)); | ||
}); | ||
} | ||
} |
47 changes: 0 additions & 47 deletions
47
....xbase.tests/src/org/eclipse/xtext/xbase/tests/formatting/XbaseCommentFormatterTest.xtend
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.