Skip to content

Commit

Permalink
Scarb: test unmanaged core (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotmag769 authored Jan 15, 2025
1 parent 7e357b3 commit 92ef9b0
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/e2e/scarb/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
mod scarb_toml_change;
mod simple_deps;
mod unmanaged_core;
48 changes: 48 additions & 0 deletions tests/e2e/scarb/unmanaged_core.rs
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,
},
}
```
"#});
}

0 comments on commit 92ef9b0

Please sign in to comment.