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:27:00 +02:00
parent 98e2490807
commit 52f9f90ccb
4 changed files with 97 additions and 91 deletions

View file

@ -1,5 +1,4 @@
use crate::{DisplayId, Executor, Platform, PlatformTextSystem, TestDispatcher};
use rand::prelude::*;
use crate::{DisplayId, Executor, Platform, PlatformTextSystem};
use std::sync::Arc;
pub struct TestPlatform {
@ -7,11 +6,8 @@ pub struct TestPlatform {
}
impl TestPlatform {
pub fn new(seed: u64) -> Self {
let rng = StdRng::seed_from_u64(seed);
TestPlatform {
executor: Executor::new(Arc::new(TestDispatcher::new(rng))),
}
pub fn new(executor: Executor) -> Self {
TestPlatform { executor }
}
}