Skip to content

Commit

Permalink
Add support for compiler experimental features in `snforge-test-colle…
Browse files Browse the repository at this point in the history
…ctor`

commit-id:774bde45

revert previous commit

update snforge-test-collector

remove unused method

review update - forge test collector
  • Loading branch information
tomek0123456789 committed Jan 16, 2024
1 parent 466d169 commit d00a2a5
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions extensions/scarb-snforge-test-collector/src/metadata.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{anyhow, ensure, Context, Result};
use cairo_lang_filesystem::db::{CrateSettings, Edition};
use cairo_lang_filesystem::db::{CrateSettings, Edition, ExperimentalFeaturesConfig};
use cairo_lang_project::AllCratesConfig;
use cairo_lang_utils::ordered_hash_map::OrderedHashMap;
use camino::{Utf8Path, Utf8PathBuf};
Expand Down Expand Up @@ -109,24 +109,25 @@ impl CompilationUnit<'_> {
.components
.iter()
.map(|component| {
let pkg = self
.metadata
.get_package(&component.package)
.unwrap_or_else(|| panic!("Failed to find = {} package", &component.package));
(
SmolStr::from(&component.name),
CrateSettings {
edition: if let Some(edition) = self
.metadata
.get_package(&component.package)
.unwrap_or_else(|| {
panic!("Failed to find = {} package", component.package)
})
.edition
.clone()
{
edition: if let Some(edition) = pkg.edition.clone() {
let edition_value = serde_json::Value::String(edition);
serde_json::from_value(edition_value).unwrap()
} else {
Edition::default()
},
experimental_features: Default::default(),
// TODO (#1040): replace this with a macro
experimental_features: ExperimentalFeaturesConfig {
negative_impls: pkg
.experimental_features
.contains(&String::from("negative_impls")),
},
},
)
})
Expand Down

0 comments on commit d00a2a5

Please sign in to comment.