Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 62dc73c2 authored by Michael Biebl's avatar Michael Biebl Committed by GitHub
Browse files

Use system defined line separator (#1562)

This fixes the test suite on Windows.
Windows uses CR LF, in contrast to Linux which uses LF. So do not
hard-code the value.
parent 58344099
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ package at.bitfire.davdroid.log
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
import java.lang.System.lineSeparator
import java.util.logging.Formatter
import java.util.logging.Level
import java.util.logging.LogRecord
@@ -19,8 +20,8 @@ class StringHandlerTest {
        handler.publish(LogRecord(Level.INFO, "Line 1"))
        handler.publish(LogRecord(Level.FINEST, "Line 2"))
        val str = handler.toString()
        assertTrue(str.contains("Line 1\n"))
        assertTrue(str.contains("Line 2\n"))
        assertTrue(str.contains("Line 1${lineSeparator()}"))
        assertTrue(str.contains("Line 2${lineSeparator()}"))
    }

    @Test