Fixed line separators for fix maven build on Windows.

This commit is contained in:
Zalim Bashorov
2014-04-16 18:06:28 +04:00
parent 361c81bbe5
commit 23922c1387
4 changed files with 9 additions and 12 deletions
@@ -16,13 +16,12 @@
package org.jetbrains.k2js.test.semantics;
import com.intellij.openapi.util.io.FileUtil;
import org.jetbrains.k2js.config.EcmaVersion;
import java.io.FileInputStream;
import java.io.File;
import java.io.IOException;
import static com.intellij.openapi.util.io.FileUtil.loadTextAndClose;
public final class StringTest extends AbstractExpressionTest {
public StringTest() {
@@ -75,8 +74,7 @@ public final class StringTest extends AbstractExpressionTest {
private void checkHasNoToStringCalls() throws IOException {
for (EcmaVersion ecmaVersion : DEFAULT_ECMA_VERSIONS) {
String filePath = getOutputFilePath(getTestName(true) + ".kt", ecmaVersion);
//noinspection IOResourceOpenedButNotSafelyClosed
String text = loadTextAndClose(new FileInputStream(filePath));
String text = FileUtil.loadFile(new File(filePath), /*convertLineSeparators = */ true);
assertFalse(filePath + " should not contain toString calls", text.contains("toString"));
}
}
@@ -21,7 +21,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.k2js.config.EcmaVersion;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.EnumSet;
@@ -49,9 +48,7 @@ public final class JsTestUtils {
@NotNull
public static String readFile(@NotNull String path) throws IOException {
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
FileInputStream stream = new FileInputStream(new File(path));
return FileUtil.loadTextAndClose(stream);
return FileUtil.loadFile(new File(path), /*convertLineSeparators = */ true);
}
@NotNull