import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
-import java.io.FileWriter;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
import java.io.StringReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
Path baseDir = temp.newFolder().toPath();
Path testFile = baseDir.resolve("src").resolve("Foo.php");
Files.createDirectories(testFile.getParent());
- try (BufferedWriter out = new BufferedWriter(new FileWriter(testFile.toFile()))) {
+ try (BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(testFile.toFile()), StandardCharsets.UTF_8))) {
out.write('\ufeff');
}
String content = "test é string €";
DefaultInputFile inputFile = builder.create(filePath, Type.MAIN, StandardCharsets.UTF_8);
assertThat(inputFile.moduleKey()).isEqualTo("module1");
- assertThat(inputFile.absolutePath()).isEqualTo(filePath.toString());
+ assertThat(inputFile.absolutePath()).isEqualTo(filePath.toString().replaceAll("\\\\", "/"));
assertThat(inputFile.key()).isEqualTo("module1:src/File1.xoo");
assertThat(inputFile.publish()).isFalse();
}