fix(solc): off by one error finding version intersection (#930)

* fix: off by one error while finding intersection

* test: enable test
This commit is contained in:
Matthias Seitz 2022-02-18 18:24:02 +01:00 committed by GitHub
parent d8e5e536cc
commit 28df48b530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View File

@ -79,7 +79,8 @@ pub static RELEASES: once_cell::sync::Lazy<(svm::Releases, Vec<Version>, bool)>
/// A `Solc` version is either installed (available locally) or can be downloaded, from the remote /// A `Solc` version is either installed (available locally) or can be downloaded, from the remote
/// endpoint /// endpoint
#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SolcVersion { pub enum SolcVersion {
Installed(Version), Installed(Version),
Remote(Version), Remote(Version),

View File

@ -476,7 +476,7 @@ impl Graph {
} }
let mut result = sets.pop().cloned().expect("not empty; qed.").clone(); let mut result = sets.pop().cloned().expect("not empty; qed.").clone();
if sets.len() > 1 { if !sets.is_empty() {
result.retain(|item| sets.iter().all(|set| set.contains(item))); result.retain(|item| sets.iter().all(|set| set.contains(item)));
} }

View File

@ -24,7 +24,6 @@ fn init_tracing() {
} }
#[test] #[test]
#[ignore]
fn can_get_versioned_linkrefs() { fn can_get_versioned_linkrefs() {
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("test-data/test-versioned-linkrefs"); let root = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("test-data/test-versioned-linkrefs");
let paths = ProjectPathsConfig::builder() let paths = ProjectPathsConfig::builder()
@ -37,8 +36,6 @@ fn can_get_versioned_linkrefs() {
let compiled = project.compile().unwrap(); let compiled = project.compile().unwrap();
assert!(!compiled.has_compiler_errors()); assert!(!compiled.has_compiler_errors());
// TODO:
} }
#[test] #[test]