package de.tudresden.slr.latexexport.latexgeneration;

import static org.junit.Assert.assertEquals;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;

public class SlrLatexGeneratorTest {
	@Rule
	public TemporaryFolder tempFolder = new TemporaryFolder();
	
	SlrLatexGenerator generator;
		
	@Test
	public void testGetResourceContentAsString() throws IOException {
		String fileContent = "hello there";
		
		File file = tempFolder.newFile();
		FileOutputStream fileOutputStream = new FileOutputStream(file);
		fileOutputStream.write(fileContent.getBytes());
		
		generator = new SlrLatexGenerator();
		
		String fileRead = generator.getResourceContentAsString(file.toURI().toURL());
		
		assertEquals(System.getProperty("line.separator")+fileContent, fileRead);
	}

}

@@ -689,24 +689,53 @@
 tBytes());%0D%0A
+%09%09fileOutputStream.close();%0D%0A
 %09%09%0D%0A%09%09genera
@@ -874,44 +874,14 @@
 als(
-System.getProperty(%22line.separator%22)
+%22%5Cr%5Cn%22
 +fil

Fix SlrLatexGenerator test for non CRLF-systems