normalize_features_arg

Function normalize_features_arg 

Source
pub fn normalize_features_arg(input: &str) -> String
Expand description

Normalises a --features argument to the label format used by the matrix.

Accepts both the comma-separated cargo format ("otel,test") and the human-readable label format ("otel + test"), sorts the parts alphabetically, and joins them with " + ". An empty input returns "default".

ยงExamples

use xtask_lib::tasks::util::matrix::normalize_features_arg;

assert_eq!(normalize_features_arg("otel,test"), "otel + test");
assert_eq!(normalize_features_arg("otel + test"), "otel + test");
assert_eq!(normalize_features_arg("test,otel"), "otel + test");
assert_eq!(normalize_features_arg(""), "default");
assert_eq!(normalize_features_arg("  "), "default");
assert_eq!(normalize_features_arg(",,"), "default");
assert_eq!(normalize_features_arg("+"), "default");
assert_eq!(normalize_features_arg("otel"), "otel");