Implement TestAppContext::new

Co-Authored-By: Max <max@zed.dev>
Co-Authored-By: Conrad <conrad@zed.dev>
Co-Authored-By: Kyle <kyle@zed.dev>
This commit is contained in:
Antonio Scandurra
2023-10-25 18:28:05 +02:00
co-authored by Max Conrad Kyle
parent 98e2490807
commit 52f9f90ccb
4 changed files with 97 additions and 91 deletions
+6 -2
View File
@@ -139,11 +139,15 @@ impl Boundary {
#[cfg(test)]
mod tests {
use super::*;
use crate::{font, App};
use crate::{font, TestAppContext, TestDispatcher};
use rand::prelude::*;
#[test]
fn test_wrap_line() {
App::test(0).run(|cx| {
let dispatcher = TestDispatcher::new(StdRng::seed_from_u64(0));
let cx = TestAppContext::new(dispatcher);
cx.update(|cx| {
let text_system = cx.text_system().clone();
let mut wrapper = LineWrapper::new(
text_system.font_id(&font("Courier")).unwrap(),