aboutsummaryrefslogtreecommitdiff
path: root/helix-term/tests/test/helpers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/tests/test/helpers.rs')
-rw-r--r--helix-term/tests/test/helpers.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/helix-term/tests/test/helpers.rs b/helix-term/tests/test/helpers.rs
index 112b5e35..a978f386 100644
--- a/helix-term/tests/test/helpers.rs
+++ b/helix-term/tests/test/helpers.rs
@@ -139,7 +139,7 @@ pub async fn test_key_sequence_with_input_text<T: Into<TestCase>>(
let test_case = test_case.into();
let mut app = match app {
Some(app) => app,
- None => Application::new(Args::default(), test_config(), test_syntax_conf(None))?,
+ None => Application::new(Args::default(), test_config(), test_syntax_loader(None))?,
};
let (view, doc) = helix_view::current!(app.editor);
@@ -162,9 +162,9 @@ pub async fn test_key_sequence_with_input_text<T: Into<TestCase>>(
.await
}
-/// Generates language configs that merge in overrides, like a user language
+/// Generates language config loader that merge in overrides, like a user language
/// config. The argument string must be a raw TOML document.
-pub fn test_syntax_conf(overrides: Option<String>) -> helix_core::syntax::Configuration {
+pub fn test_syntax_loader(overrides: Option<String>) -> helix_core::syntax::Loader {
let mut lang = helix_loader::config::default_lang_config();
if let Some(overrides) = overrides {
@@ -172,7 +172,7 @@ pub fn test_syntax_conf(overrides: Option<String>) -> helix_core::syntax::Config
lang = helix_loader::merge_toml_values(lang, override_toml, 3);
}
- lang.try_into().unwrap()
+ helix_core::syntax::Loader::new(lang.try_into().unwrap()).unwrap()
}
/// Use this for very simple test cases where there is one input
@@ -271,7 +271,7 @@ pub fn new_readonly_tempfile() -> anyhow::Result<NamedTempFile> {
pub struct AppBuilder {
args: Args,
config: Config,
- syn_conf: helix_core::syntax::Configuration,
+ syn_loader: helix_core::syntax::Loader,
input: Option<(String, Selection)>,
}
@@ -280,7 +280,7 @@ impl Default for AppBuilder {
Self {
args: Args::default(),
config: test_config(),
- syn_conf: test_syntax_conf(None),
+ syn_loader: test_syntax_loader(None),
input: None,
}
}
@@ -314,8 +314,8 @@ impl AppBuilder {
self
}
- pub fn with_lang_config(mut self, syn_conf: helix_core::syntax::Configuration) -> Self {
- self.syn_conf = syn_conf;
+ pub fn with_lang_loader(mut self, syn_loader: helix_core::syntax::Loader) -> Self {
+ self.syn_loader = syn_loader;
self
}
@@ -328,7 +328,7 @@ impl AppBuilder {
bail!("Having the directory {path:?} in args.files[0] is not yet supported for integration tests");
}
- let mut app = Application::new(self.args, self.config, self.syn_conf)?;
+ let mut app = Application::new(self.args, self.config, self.syn_loader)?;
if let Some((text, selection)) = self.input {
let (view, doc) = helix_view::current!(app.editor);