Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add long env test #84

Merged
merged 3 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "test-with"
version = "0.12.4"
version = "0.12.5"
authors = ["Antonio Yang <[email protected]>"]
edition = "2021"
license = "MIT"
Expand Down
9 changes: 9 additions & 0 deletions examples/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ mod tests {
fn test_ignore_in_github_action() {
println!("should be ignored in GITHUB_ACTION");
}

#[test_with::env(
IT_SOME_LONG_ENV_VAR_NAME_TEST_URL,
IT_SOME_LONG_ENV_VAR_NAME_TEST_AUTH_TOKEN
)]
#[test]
fn test_ignored_with_long_env() {
panic!("should be ignored")
}
}

#[test_with::env(PWD)]
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ pub(crate) fn mod_macro(

/// Sanitize the attribute string to remove any leading or trailing whitespace
/// and split the string into an iterator of individual environment variable names.
pub fn sanitize_env_vars_attr(attr_str: &str) -> impl Iterator<Item=&str> {
pub fn sanitize_env_vars_attr(attr_str: &str) -> impl Iterator<Item = &str> {
attr_str.split(',').map(str::trim)
}

Expand Down
Loading