mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
test for IDEA-199694 Preserve line breaks in XML when reformatting.
This commit is contained in:
@@ -363,4 +363,16 @@ public class XmlFormatterTest extends XmlFormatterTestBase {
|
||||
xmlSettings.XML_TEXT_WRAP = CommonCodeStyleSettings.DO_NOT_WRAP;
|
||||
doTextTest("<tag>aaa\nbbb\nccc\nddd\n</tag>", "<tag>aaa bbb ccc ddd\n</tag>");
|
||||
}
|
||||
|
||||
public void testXmlCommentLineBreak() throws Exception {
|
||||
XmlCodeStyleSettings xmlSettings = getSettings().getCustomSettings(XmlCodeStyleSettings.class);
|
||||
boolean oldValue = xmlSettings.XML_KEEP_LINE_BREAKS;
|
||||
xmlSettings.XML_KEEP_LINE_BREAKS = false;
|
||||
try {
|
||||
doTest();
|
||||
}
|
||||
finally {
|
||||
xmlSettings.XML_KEEP_LINE_BREAKS = oldValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<!--<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"-->
|
||||
<!--xmlns:app="http://schemas.android.com/apk/res-auto"-->
|
||||
<!--xmlns:tools="http://schemas.android.com/tools"-->
|
||||
<!--android:layout_width="match_parent"-->
|
||||
<!--android:layout_height="match_parent"-->
|
||||
<!--tools:context=".MainActivity">-->
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:text="Hello World!"-->
|
||||
<!--app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!--app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!--app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!--app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<!--</android.support.constraint.ConstraintLayout>-->
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity">
|
||||
|
||||
<TextView android:layout_width="match_parent" android:layout_height="match_parent"/>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<!--<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"-->
|
||||
<!--xmlns:app="http://schemas.android.com/apk/res-auto"-->
|
||||
<!--xmlns:tools="http://schemas.android.com/tools"-->
|
||||
<!--android:layout_width="match_parent"-->
|
||||
<!--android:layout_height="match_parent"-->
|
||||
<!--tools:context=".MainActivity">-->
|
||||
|
||||
<!--<TextView-->
|
||||
<!--android:layout_width="wrap_content"-->
|
||||
<!--android:layout_height="wrap_content"-->
|
||||
<!--android:text="Hello World!"-->
|
||||
<!--app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!--app:layout_constraintLeft_toLeftOf="parent"-->
|
||||
<!--app:layout_constraintRight_toRightOf="parent"-->
|
||||
<!--app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<!--</android.support.constraint.ConstraintLayout>-->
|
||||
Reference in New Issue
Block a user