summaryrefslogtreecommitdiff
path: root/helix-term/tests/test/helpers.rs
diff options
context:
space:
mode:
authorSkyler Hawthorne2022-11-11 04:58:03 +0000
committerMichael Davis2023-03-20 23:34:40 +0000
commit4bdeb9927b5aa0fb71484faae8f3aa9c5ce67381 (patch)
tree6c348fd5ff2d937560df81ced6572cfa8b14050c /helix-term/tests/test/helpers.rs
parentd3b051d28ea62c313fc72583d04f2a897e8d6f40 (diff)
migrate test_with_config to use AppBuilder
Diffstat (limited to 'helix-term/tests/test/helpers.rs')
-rw-r--r--helix-term/tests/test/helpers.rs17
1 files changed, 4 insertions, 13 deletions
diff --git a/helix-term/tests/test/helpers.rs b/helix-term/tests/test/helpers.rs
index 77332fa5..ccd07bfa 100644
--- a/helix-term/tests/test/helpers.rs
+++ b/helix-term/tests/test/helpers.rs
@@ -178,14 +178,11 @@ pub fn test_syntax_conf(overrides: Option<String>) -> helix_core::syntax::Config
/// document, selection, and sequence of key presses, and you just
/// want to verify the resulting document and selection.
pub async fn test_with_config<T: Into<TestCase>>(
- args: Args,
- mut config: Config,
- syn_conf: helix_core::syntax::Configuration,
+ app_builder: AppBuilder,
test_case: T,
) -> anyhow::Result<()> {
let test_case = test_case.into();
- config = helix_term::keymap::merge_keys(config);
- let app = Application::new(args, config, syn_conf)?;
+ let app = app_builder.build()?;
test_key_sequence_with_input_text(
Some(app),
@@ -206,13 +203,7 @@ pub async fn test_with_config<T: Into<TestCase>>(
}
pub async fn test<T: Into<TestCase>>(test_case: T) -> anyhow::Result<()> {
- test_with_config(
- Args::default(),
- test_config(),
- test_syntax_conf(None),
- test_case,
- )
- .await
+ test_with_config(AppBuilder::default(), test_case).await
}
pub fn temp_file_with_contents<S: AsRef<str>>(
@@ -310,7 +301,7 @@ impl AppBuilder {
// Remove this attribute once `with_config` is used in a test:
#[allow(dead_code)]
pub fn with_config(mut self, config: Config) -> Self {
- self.config = config;
+ self.config = helix_term::keymap::merge_keys(config);
self
}