Skip to content

Commit

Permalink
Fix compilation error in integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pfoerster committed Jun 8, 2019
1 parent fd0edad commit d0b2ca3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
26 changes: 13 additions & 13 deletions tests/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub async fn run(scenario: &'static str, file: &'static str, position: Position)
.unwrap()
.items
.into_iter()
.map(|item| item.label.into_owned())
.map(|item| (*item.label).to_owned())
.sorted()
.collect()
}
Expand Down Expand Up @@ -80,7 +80,7 @@ fn test_citation() {
fn test_symbol_command_kernel() {
block_on(async move {
let items = run("symbol", "foo.tex", Position::new(0, 1)).await;
assert_eq!(items.iter().any(|item| item == "varepsilon"), true);
assert!(items.iter().any(|item| item == "varepsilon"));
});
}

Expand All @@ -97,15 +97,15 @@ fn test_symbol_argument() {
fn test_color() {
block_on(async move {
let items = run("color", "foo.tex", Position::new(0, 10)).await;
assert_eq!(items.iter().any(|item| item == "black"), true);
assert!(items.iter().any(|item| item == "black"));
});
}

#[test]
fn test_color_model() {
block_on(async move {
let items = run("color", "foo.tex", Position::new(1, 18)).await;
assert_eq!(items.iter().any(|item| item == "rgb"), true);
assert!(items.iter().any(|item| item == "rgb"));
});
}

Expand Down Expand Up @@ -153,70 +153,70 @@ fn test_include_graphics_svg() {
fn test_import_class() {
block_on(async move {
let items = run("import", "foo.tex", Position::new(0, 18)).await;
assert_eq!(items.iter().any(|item| item == "article"), true);
assert!(items.iter().any(|item| item == "article"));
});
}

#[test]
fn test_import_package() {
block_on(async move {
let items = run("import", "foo.tex", Position::new(1, 15)).await;
assert_eq!(items.iter().any(|item| item == "amsmath"), true);
assert!(items.iter().any(|item| item == "amsmath"));
});
}

#[test]
fn test_pgf_library() {
block_on(async move {
let items = run("pgf_library", "foo.tex", Position::new(0, 18)).await;
assert_eq!(items.iter().any(|item| item == "arrows"), true);
assert!(items.iter().any(|item| item == "arrows"));
});
}

#[test]
fn test_tikz_library() {
block_on(async move {
let items = run("tikz_library", "foo.tex", Position::new(0, 19)).await;
assert_eq!(items.iter().any(|item| item == "arrows"), true);
assert!(items.iter().any(|item| item == "arrows"));
});
}

#[test]
fn test_entry_type() {
block_on(async move {
let items = run("entry_type", "foo.bib", Position::new(0, 1)).await;
assert_eq!(items.iter().any(|item| item == "article"), true);
assert!(items.iter().any(|item| item == "article"));
});
}

#[test]
fn test_entry_type_preamble() {
block_on(async move {
let items = run("entry_type", "foo.bib", Position::new(1, 3)).await;
assert_eq!(items.iter().any(|item| item == "preamble"), true);
assert!(items.iter().any(|item| item == "preamble"));
});
}

#[test]
fn test_entry_type_string() {
block_on(async move {
let items = run("entry_type", "foo.bib", Position::new(2, 3)).await;
assert_eq!(items.iter().any(|item| item == "string"), true);
assert!(items.iter().any(|item| item == "string"));
});
}

#[test]
fn test_entry_type_comment() {
block_on(async move {
let items = run("entry_type", "foo.bib", Position::new(3, 3)).await;
assert_eq!(items.iter().any(|item| item == "comment"), true);
assert!(items.iter().any(|item| item == "comment"));
});
}

#[test]
fn test_field_name() {
block_on(async move {
let items = run("field_name", "foo.bib", Position::new(1, 7)).await;
assert_eq!(items.iter().any(|item| item == "author"), true);
assert!(items.iter().any(|item| item == "author"));
});
}
3 changes: 2 additions & 1 deletion tests/synchronization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ use futures::executor::block_on;
use jsonrpc::server::ActionHandler;
use lsp_types::*;
use texlab::scenario::Scenario;
use std::sync::Arc;

async fn run_completion(
scenario: &Scenario,
file: &'static str,
position: Position,
) -> Vec<CompletionItem> {
) -> Vec<Arc<CompletionItem>> {
let params = CompletionParams {
text_document: TextDocumentIdentifier::new(scenario.uri(file)),
position,
Expand Down

0 comments on commit d0b2ca3

Please sign in to comment.