Skip to content

Commit

Permalink
update integration
Browse files Browse the repository at this point in the history
  • Loading branch information
kirawi committed Feb 18, 2023
1 parent b49fa5f commit b83fb40
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion helix-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include = ["src/**/*", "README.md"]

[features]
unicode-lines = ["ropey/unicode_lines"]
integration = []
integration = ["helix-loader/integration"]

[dependencies]
helix-loader = { version = "0.6", path = "../helix-loader" }
Expand Down
4 changes: 2 additions & 2 deletions helix-core/src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ mod test {
fn serde_history(original: String, changes_a: Vec<String>, changes_b: Vec<String>) -> bool {
fn create_changes(history: &mut History, doc: &mut Rope, changes: Vec<String>) {
for c in changes.into_iter().map(Rope::from) {
let transaction = crate::diff::compare_ropes(&doc, &c);
let transaction = crate::diff::compare_ropes(doc, &c);
let state = State {
doc: doc.clone(),
selection: Selection::point(0),
Expand All @@ -804,8 +804,8 @@ mod test {
let (_, res) = History::deserialize(&mut cursor, file.path()).unwrap();
assert_eq!(history, res);

create_changes(&mut history, &mut original, changes_b);
cursor.set_position(0);
create_changes(&mut history, &mut original, changes_b);
history
.serialize(&mut cursor, file.path(), 0, true)
.unwrap();
Expand Down
3 changes: 3 additions & 0 deletions helix-loader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ homepage = "https://helix-editor.com"
name = "hx-loader"
path = "src/main.rs"

[features]
integration = []

[dependencies]
anyhow = "1"
serde = { version = "1.0", features = ["derive"] }
Expand Down
10 changes: 7 additions & 3 deletions helix-loader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,13 @@ pub fn local_config_dirs() -> Vec<PathBuf> {
}

pub fn cache_dir() -> PathBuf {
// TODO: allow env var override
let strategy = choose_base_strategy().expect("Unable to find the config directory!");
let mut path = strategy.cache_dir();
let mut path = if cfg!(feature = "integration") {
std::env::temp_dir()
} else {
// TODO: allow env var override
let strategy = choose_base_strategy().expect("Unable to find the config directory!");
strategy.cache_dir()
};
path.push("helix");
path
}
Expand Down

0 comments on commit b83fb40

Please sign in to comment.