-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #593 from lolgab/fix-tests-js-native
Fix dependencies to be platformed and fix newly enabled tests
- Loading branch information
Showing
7 changed files
with
106 additions
and
98 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
2 changes: 1 addition & 1 deletion
2
.../scala/spec/AsynchronousLoggingSpec.scala → ...scala/specs/AsynchronousLoggingSpec.scala
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,47 @@ | ||
package specs | ||
|
||
import org.scalatest.matchers.should.Matchers | ||
import org.scalatest.wordspec.AnyWordSpec | ||
import scribe.Logger | ||
import scribe.mdc._ | ||
import scribe.writer.CacheWriter | ||
|
||
class MDCThreadSpec extends AnyWordSpec with Matchers { | ||
private lazy val writer = new CacheWriter | ||
private lazy val logger = Logger("mdc-test").orphan().withHandler(writer = writer) | ||
|
||
"MDC" should { | ||
"verify concurrency access to implicits" in { | ||
implicit val mdc: MDC = MDC.instance | ||
logger.info("Zero") | ||
mdc.context("test" -> "testing") { | ||
logger.info("One") | ||
mdc.context("test" -> "testing2") { | ||
logger.info("Two") | ||
var finished = false | ||
new Thread { | ||
override def run(): Unit = { | ||
logger.info("Three") | ||
finished = true | ||
} | ||
}.start() | ||
while (!finished) { | ||
Thread.sleep(10) | ||
} | ||
} | ||
logger.info("Four") | ||
} | ||
logger.info("Five") | ||
writer.consume { list => | ||
list.map(r => r.messages.head.logOutput.plainText -> r.data.get("test").map(_())) should be(List( | ||
"Five" -> None, | ||
"Four" -> Some("testing"), | ||
"Three" -> Some("testing2"), | ||
"Two" -> Some("testing2"), | ||
"One" -> Some("testing"), | ||
"Zero" -> None | ||
)) | ||
} | ||
} | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.