-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e357b3
commit 92ef9b0
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
mod scarb_toml_change; | ||
mod simple_deps; | ||
mod unmanaged_core; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
use cairo_language_server::lsp; | ||
use indoc::indoc; | ||
|
||
use crate::support::normalize::normalize; | ||
use crate::support::sandbox; | ||
|
||
#[test] | ||
fn test_unmanaged_core_on_invalid_scarb_toml() { | ||
let mut ls = sandbox! { | ||
files { | ||
"Scarb.toml" => indoc! { r#" | ||
[package] | ||
version = "0.1.0" | ||
"#}, | ||
"src/lib.cairo" => "", | ||
} | ||
}; | ||
|
||
ls.open_and_wait_for_project_update("src/lib.cairo"); | ||
|
||
let analyzed_crates = ls.send_request::<lsp::ext::ViewAnalyzedCrates>(()); | ||
|
||
pretty_assertions::assert_eq!(normalize(&ls, analyzed_crates), indoc! {r#" | ||
# Analyzed Crates | ||
- `core`: `["[SCARB_REGISTRY_STD]/core/src/lib.cairo"]` | ||
```rust | ||
CrateSettings { | ||
name: None, | ||
edition: V2024_07, | ||
version: Some( | ||
Version { | ||
major: 2, | ||
minor: 9, | ||
patch: 2, | ||
}, | ||
), | ||
cfg_set: None, | ||
dependencies: {}, | ||
experimental_features: ExperimentalFeaturesConfig { | ||
negative_impls: true, | ||
associated_item_constraints: true, | ||
coupons: true, | ||
}, | ||
} | ||
``` | ||
"#}); | ||
} |