-
Notifications
You must be signed in to change notification settings - Fork 418
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d6536d
commit 9e15f07
Showing
19 changed files
with
181 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package basic | ||
|
||
import org.jetbrains.dokka.utilities.DokkaConsoleLogger | ||
import org.jetbrains.dokka.utilities.LoggingLevel | ||
import org.jetbrains.dokka.utilities.MessageEmitter | ||
import org.junit.jupiter.api.Test | ||
import kotlin.test.assertFalse | ||
import kotlin.test.assertTrue | ||
|
||
class LoggerTest { | ||
class AccumulatingEmitter : MessageEmitter { | ||
val messages: MutableList<String> = mutableListOf() | ||
override fun invoke(message: String) { | ||
messages.add(message) | ||
} | ||
} | ||
|
||
@Test | ||
fun `should display info messages if logging is info`(){ | ||
val emitter = AccumulatingEmitter() | ||
val logger = DokkaConsoleLogger(LoggingLevel.INFO, emitter) | ||
|
||
logger.debug("Debug!") | ||
logger.info("Info!") | ||
|
||
assertTrue(emitter.messages.size > 0) | ||
assertTrue(emitter.messages.any { it == "Info!" }) | ||
assertFalse(emitter.messages.any { it == "Debug!" }) | ||
} | ||
|
||
@Test | ||
fun `should not display info messages if logging is warn`(){ | ||
val emitter = AccumulatingEmitter() | ||
val logger = DokkaConsoleLogger(LoggingLevel.WARN, emitter) | ||
|
||
logger.warn("Warning!") | ||
logger.info("Info!") | ||
|
||
|
||
assertTrue(emitter.messages.size > 0) | ||
assertFalse(emitter.messages.any { it.contains("Info!") }) | ||
assertTrue(emitter.messages.any { it.contains("Warning!") }) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.