Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit dd96b56

Browse files
authored
Merge pull request #1694 from cuviper/typo-autocfg
Test typos with autocfg
2 parents dab1468 + ec349b9 commit dd96b56

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/client.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -631,11 +631,11 @@ fn client_use_statement_completion_doesnt_suggest_arguments() {
631631
///
632632
/// ```
633633
/// [dependencies]
634-
/// version-check = "0.5555"
634+
/// auto-cfg = "0.5555"
635635
/// ```
636636
///
637-
/// * Firstly "version-check" doesn't exist, it should be "version_check"
638-
/// * Secondly version 0.5555 of "version_check" doesn't exist.
637+
/// * Firstly "auto-cfg" doesn't exist, it should be "autocfg"
638+
/// * Secondly version 0.5555 of "autocfg" doesn't exist.
639639
#[test]
640640
fn client_dependency_typo_and_fix() {
641641
let manifest_with_dependency = |dep: &str| {
@@ -654,7 +654,7 @@ fn client_dependency_typo_and_fix() {
654654
};
655655

656656
let p = project("dependency_typo")
657-
.file("Cargo.toml", &manifest_with_dependency(r#"version-check = "0.5555""#))
657+
.file("Cargo.toml", &manifest_with_dependency(r#"auto-cfg = "0.5555""#))
658658
.file(
659659
"src/main.rs",
660660
r#"
@@ -672,14 +672,14 @@ fn client_dependency_typo_and_fix() {
672672
let diag = rls.wait_for_diagnostics();
673673
assert_eq!(diag.diagnostics.len(), 1);
674674
assert_eq!(diag.diagnostics[0].severity, Some(DiagnosticSeverity::Error));
675-
assert!(diag.diagnostics[0].message.contains("no matching package named `version-check`"));
675+
assert!(diag.diagnostics[0].message.contains("no matching package named `auto-cfg`"));
676676

677677
let change_manifest = |contents: &str| {
678678
std::fs::write(root_path.join("Cargo.toml"), contents).unwrap();
679679
};
680680

681681
// fix naming typo, we now expect a version error diagnostic
682-
change_manifest(&manifest_with_dependency(r#"version_check = "0.5555""#));
682+
change_manifest(&manifest_with_dependency(r#"autocfg = "0.5555""#));
683683
rls.notify::<DidChangeWatchedFiles>(DidChangeWatchedFilesParams {
684684
changes: vec![FileEvent {
685685
uri: Url::from_file_path(p.root().join("Cargo.toml")).unwrap(),
@@ -694,8 +694,8 @@ fn client_dependency_typo_and_fix() {
694694

695695
// Fix version issue so no error diagnostics occur.
696696
// This is kinda slow as cargo will compile the dependency, though I
697-
// chose version_check to minimise this as it is a very small dependency.
698-
change_manifest(&manifest_with_dependency(r#"version_check = "0.1""#));
697+
// chose autocfg to minimise this as it is a very small dependency.
698+
change_manifest(&manifest_with_dependency(r#"autocfg = "1""#));
699699
rls.notify::<DidChangeWatchedFiles>(DidChangeWatchedFilesParams {
700700
changes: vec![FileEvent {
701701
uri: Url::from_file_path(p.root().join("Cargo.toml")).unwrap(),

0 commit comments

Comments
 (0)