forked from Rustin170506/cargo-information
-
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.
test: Show large number of activations
- Loading branch information
Showing
7 changed files
with
490 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
tests/testsuite/cargo_information/features_activated_over_limit/mod.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,35 @@ | ||
use cargo_test_macro::cargo_test; | ||
use cargo_test_support::file; | ||
|
||
use super::{cargo_info, init_registry_without_token}; | ||
|
||
#[cargo_test] | ||
fn case() { | ||
const MANY_FEATURES_COUNT: usize = 200; | ||
const DEFAULT_FEATURES_COUNT: usize = 100; | ||
|
||
init_registry_without_token(); | ||
let mut test_package = | ||
cargo_test_support::registry::Package::new("your-face", "99999.0.0+my-package"); | ||
let features = (0..MANY_FEATURES_COUNT) | ||
.map(|i| format!("eyes{i:03}")) | ||
.collect::<Vec<_>>(); | ||
for name in &features { | ||
test_package.feature(name.as_str(), &[]); | ||
} | ||
let default_features = features | ||
.iter() | ||
.take(DEFAULT_FEATURES_COUNT) | ||
.map(|s| s.as_str()) | ||
.collect::<Vec<_>>(); | ||
test_package.feature("default", &default_features); | ||
test_package.publish(); | ||
|
||
cargo_info() | ||
.arg("your-face") | ||
.arg("--registry=dummy-registry") | ||
.assert() | ||
.success() | ||
.stdout_matches(file!["stdout.log"]) | ||
.stderr_matches(file!["stderr.log"]); | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/testsuite/cargo_information/features_activated_over_limit/stderr.log
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,3 @@ | ||
Updating `dummy-registry` index | ||
Downloading crates ... | ||
Downloaded your-face v99999.0.0+my-package (registry `dummy-registry`) |
206 changes: 206 additions & 0 deletions
206
tests/testsuite/cargo_information/features_activated_over_limit/stdout.log
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,206 @@ | ||
your-face | ||
version: 99999.0.0+my-package (from registry `dummy-registry`) | ||
license: unknown | ||
rust-version: unknown | ||
features: | ||
default = [eyes000, eyes001, eyes002, eyes003, eyes004, eyes005, eyes006, eyes007, eyes008, eyes009, eyes010, eyes011, eyes012, eyes013, eyes014, eyes015, eyes016, eyes017, eyes018, eyes019, eyes020, eyes021, eyes022, eyes023, eyes024, eyes025, eyes026, eyes027, eyes028, eyes029, eyes030, eyes031, eyes032, eyes033, eyes034, eyes035, eyes036, eyes037, eyes038, eyes039, eyes040, eyes041, eyes042, eyes043, eyes044, eyes045, eyes046, eyes047, eyes048, eyes049, eyes050, eyes051, eyes052, eyes053, eyes054, eyes055, eyes056, eyes057, eyes058, eyes059, eyes060, eyes061, eyes062, eyes063, eyes064, eyes065, eyes066, eyes067, eyes068, eyes069, eyes070, eyes071, eyes072, eyes073, eyes074, eyes075, eyes076, eyes077, eyes078, eyes079, eyes080, eyes081, eyes082, eyes083, eyes084, eyes085, eyes086, eyes087, eyes088, eyes089, eyes090, eyes091, eyes092, eyes093, eyes094, eyes095, eyes096, eyes097, eyes098, eyes099] | ||
eyes000 = [] | ||
eyes001 = [] | ||
eyes002 = [] | ||
eyes003 = [] | ||
eyes004 = [] | ||
eyes005 = [] | ||
eyes006 = [] | ||
eyes007 = [] | ||
eyes008 = [] | ||
eyes009 = [] | ||
eyes010 = [] | ||
eyes011 = [] | ||
eyes012 = [] | ||
eyes013 = [] | ||
eyes014 = [] | ||
eyes015 = [] | ||
eyes016 = [] | ||
eyes017 = [] | ||
eyes018 = [] | ||
eyes019 = [] | ||
eyes020 = [] | ||
eyes021 = [] | ||
eyes022 = [] | ||
eyes023 = [] | ||
eyes024 = [] | ||
eyes025 = [] | ||
eyes026 = [] | ||
eyes027 = [] | ||
eyes028 = [] | ||
eyes029 = [] | ||
eyes030 = [] | ||
eyes031 = [] | ||
eyes032 = [] | ||
eyes033 = [] | ||
eyes034 = [] | ||
eyes035 = [] | ||
eyes036 = [] | ||
eyes037 = [] | ||
eyes038 = [] | ||
eyes039 = [] | ||
eyes040 = [] | ||
eyes041 = [] | ||
eyes042 = [] | ||
eyes043 = [] | ||
eyes044 = [] | ||
eyes045 = [] | ||
eyes046 = [] | ||
eyes047 = [] | ||
eyes048 = [] | ||
eyes049 = [] | ||
eyes050 = [] | ||
eyes051 = [] | ||
eyes052 = [] | ||
eyes053 = [] | ||
eyes054 = [] | ||
eyes055 = [] | ||
eyes056 = [] | ||
eyes057 = [] | ||
eyes058 = [] | ||
eyes059 = [] | ||
eyes060 = [] | ||
eyes061 = [] | ||
eyes062 = [] | ||
eyes063 = [] | ||
eyes064 = [] | ||
eyes065 = [] | ||
eyes066 = [] | ||
eyes067 = [] | ||
eyes068 = [] | ||
eyes069 = [] | ||
eyes070 = [] | ||
eyes071 = [] | ||
eyes072 = [] | ||
eyes073 = [] | ||
eyes074 = [] | ||
eyes075 = [] | ||
eyes076 = [] | ||
eyes077 = [] | ||
eyes078 = [] | ||
eyes079 = [] | ||
eyes080 = [] | ||
eyes081 = [] | ||
eyes082 = [] | ||
eyes083 = [] | ||
eyes084 = [] | ||
eyes085 = [] | ||
eyes086 = [] | ||
eyes087 = [] | ||
eyes088 = [] | ||
eyes089 = [] | ||
eyes090 = [] | ||
eyes091 = [] | ||
eyes092 = [] | ||
eyes093 = [] | ||
eyes094 = [] | ||
eyes095 = [] | ||
eyes096 = [] | ||
eyes097 = [] | ||
eyes098 = [] | ||
eyes099 = [] | ||
eyes100 = [] | ||
eyes101 = [] | ||
eyes102 = [] | ||
eyes103 = [] | ||
eyes104 = [] | ||
eyes105 = [] | ||
eyes106 = [] | ||
eyes107 = [] | ||
eyes108 = [] | ||
eyes109 = [] | ||
eyes110 = [] | ||
eyes111 = [] | ||
eyes112 = [] | ||
eyes113 = [] | ||
eyes114 = [] | ||
eyes115 = [] | ||
eyes116 = [] | ||
eyes117 = [] | ||
eyes118 = [] | ||
eyes119 = [] | ||
eyes120 = [] | ||
eyes121 = [] | ||
eyes122 = [] | ||
eyes123 = [] | ||
eyes124 = [] | ||
eyes125 = [] | ||
eyes126 = [] | ||
eyes127 = [] | ||
eyes128 = [] | ||
eyes129 = [] | ||
eyes130 = [] | ||
eyes131 = [] | ||
eyes132 = [] | ||
eyes133 = [] | ||
eyes134 = [] | ||
eyes135 = [] | ||
eyes136 = [] | ||
eyes137 = [] | ||
eyes138 = [] | ||
eyes139 = [] | ||
eyes140 = [] | ||
eyes141 = [] | ||
eyes142 = [] | ||
eyes143 = [] | ||
eyes144 = [] | ||
eyes145 = [] | ||
eyes146 = [] | ||
eyes147 = [] | ||
eyes148 = [] | ||
eyes149 = [] | ||
eyes150 = [] | ||
eyes151 = [] | ||
eyes152 = [] | ||
eyes153 = [] | ||
eyes154 = [] | ||
eyes155 = [] | ||
eyes156 = [] | ||
eyes157 = [] | ||
eyes158 = [] | ||
eyes159 = [] | ||
eyes160 = [] | ||
eyes161 = [] | ||
eyes162 = [] | ||
eyes163 = [] | ||
eyes164 = [] | ||
eyes165 = [] | ||
eyes166 = [] | ||
eyes167 = [] | ||
eyes168 = [] | ||
eyes169 = [] | ||
eyes170 = [] | ||
eyes171 = [] | ||
eyes172 = [] | ||
eyes173 = [] | ||
eyes174 = [] | ||
eyes175 = [] | ||
eyes176 = [] | ||
eyes177 = [] | ||
eyes178 = [] | ||
eyes179 = [] | ||
eyes180 = [] | ||
eyes181 = [] | ||
eyes182 = [] | ||
eyes183 = [] | ||
eyes184 = [] | ||
eyes185 = [] | ||
eyes186 = [] | ||
eyes187 = [] | ||
eyes188 = [] | ||
eyes189 = [] | ||
eyes190 = [] | ||
eyes191 = [] | ||
eyes192 = [] | ||
eyes193 = [] | ||
eyes194 = [] | ||
eyes195 = [] | ||
eyes196 = [] | ||
eyes197 = [] | ||
eyes198 = [] | ||
eyes199 = [] |
35 changes: 35 additions & 0 deletions
35
tests/testsuite/cargo_information/features_deactivated_over_limit/mod.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,35 @@ | ||
use cargo_test_macro::cargo_test; | ||
use cargo_test_support::file; | ||
|
||
use super::{cargo_info, init_registry_without_token}; | ||
|
||
#[cargo_test] | ||
fn case() { | ||
const MANY_FEATURES_COUNT: usize = 200; | ||
const DEFAULT_FEATURES_COUNT: usize = 20; | ||
|
||
init_registry_without_token(); | ||
let mut test_package = | ||
cargo_test_support::registry::Package::new("your-face", "99999.0.0+my-package"); | ||
let features = (0..MANY_FEATURES_COUNT) | ||
.map(|i| format!("eyes{i:03}")) | ||
.collect::<Vec<_>>(); | ||
for name in &features { | ||
test_package.feature(name.as_str(), &[]); | ||
} | ||
let default_features = features | ||
.iter() | ||
.take(DEFAULT_FEATURES_COUNT) | ||
.map(|s| s.as_str()) | ||
.collect::<Vec<_>>(); | ||
test_package.feature("default", &default_features); | ||
test_package.publish(); | ||
|
||
cargo_info() | ||
.arg("your-face") | ||
.arg("--registry=dummy-registry") | ||
.assert() | ||
.success() | ||
.stdout_matches(file!["stdout.log"]) | ||
.stderr_matches(file!["stderr.log"]); | ||
} |
3 changes: 3 additions & 0 deletions
3
tests/testsuite/cargo_information/features_deactivated_over_limit/stderr.log
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,3 @@ | ||
Updating `dummy-registry` index | ||
Downloading crates ... | ||
Downloaded your-face v99999.0.0+my-package (registry `dummy-registry`) |
Oops, something went wrong.