-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add handling of ambiguous package definitions within the same dir. (#887
- Loading branch information
1 parent
4e86576
commit bb542c4
Showing
8 changed files
with
190 additions
and
25 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
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
9 changes: 9 additions & 0 deletions
9
test_crates/manifest_tests/multiple_ambiguous_package_name_definitions/Cargo.toml
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,9 @@ | ||
[workspace] | ||
resolver = "2" | ||
|
||
[package] | ||
name = "example" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
9 changes: 9 additions & 0 deletions
9
test_crates/manifest_tests/multiple_ambiguous_package_name_definitions/nested/Cargo.toml
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,9 @@ | ||
[workspace] | ||
resolver = "2" | ||
|
||
[package] | ||
name = "example" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
14 changes: 14 additions & 0 deletions
14
test_crates/manifest_tests/multiple_ambiguous_package_name_definitions/nested/src/lib.rs
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,14 @@ | ||
pub fn add(left: u64, right: u64) -> u64 { | ||
left + right | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
test_crates/manifest_tests/multiple_ambiguous_package_name_definitions/src/lib.rs
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,14 @@ | ||
pub fn add(left: u64, right: u64) -> u64 { | ||
left + right | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...rgo_semver_checks__snapshot_tests__multiple_ambiguous_package_name_definitions-input.snap
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,30 @@ | ||
--- | ||
source: src/snapshot_tests.rs | ||
expression: check | ||
--- | ||
Check( | ||
scope: Scope( | ||
mode: DenyList(PackageSelection( | ||
selection: DefaultMembers, | ||
excluded_packages: [], | ||
)), | ||
), | ||
current: Rustdoc( | ||
source: Root("test_crates/manifest_tests/multiple_ambiguous_package_name_definitions"), | ||
), | ||
baseline: Rustdoc( | ||
source: Root("test_crates/manifest_tests/multiple_ambiguous_package_name_definitions"), | ||
), | ||
release_type: None, | ||
current_feature_config: FeatureConfig( | ||
features_group: Heuristic, | ||
extra_features: [], | ||
is_baseline: false, | ||
), | ||
baseline_feature_config: FeatureConfig( | ||
features_group: Heuristic, | ||
extra_features: [], | ||
is_baseline: true, | ||
), | ||
build_target: None, | ||
) |
13 changes: 13 additions & 0 deletions
13
...go_semver_checks__snapshot_tests__multiple_ambiguous_package_name_definitions-output.snap
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,13 @@ | ||
--- | ||
source: src/snapshot_tests.rs | ||
expression: result | ||
--- | ||
--- error --- | ||
package `example` is ambiguous: it is defined by in multiple manifests within the root path test_crates/manifest_tests/multiple_ambiguous_package_name_definitions | ||
|
||
defined in: | ||
test_crates/manifest_tests/multiple_ambiguous_package_name_definitions/Cargo.toml | ||
test_crates/manifest_tests/multiple_ambiguous_package_name_definitions/nested/Cargo.toml | ||
--- stdout --- | ||
|
||
--- stderr --- |