#![allow(
private_interfaces,
reason = "The marker structs don't need to be exposed, only the static values."
)]
use crate::*;
mod cell_path_types;
mod enforce_runtime_annotations;
mod example;
mod native_clip;
mod pipefail;
mod reorder_cell_paths;
pub(crate) type Version = (u16, u16, u16);
pub(crate) trait ExperimentalOptionMarker {
const IDENTIFIER: &'static str;
const DESCRIPTION: &'static str;
const STATUS: Status;
const SINCE: Version;
const ISSUE: u32;
}
pub use cell_path_types::CELL_PATH_TYPES;
pub use enforce_runtime_annotations::ENFORCE_RUNTIME_ANNOTATIONS;
pub use example::EXAMPLE;
pub use native_clip::NATIVE_CLIP;
pub use pipefail::PIPE_FAIL;
pub use reorder_cell_paths::REORDER_CELL_PATHS;
pub static ALL: &[&ExperimentalOption] = &[
&EXAMPLE,
&REORDER_CELL_PATHS,
&PIPE_FAIL,
&ENFORCE_RUNTIME_ANNOTATIONS,
&NATIVE_CLIP,
&CELL_PATH_TYPES,
];
#[cfg(test)]
mod tests {
use std::collections::HashSet;
use super::*;
#[test]
fn assert_identifiers_are_unique() {
let list: Vec<_> = ALL.iter().map(|opt| opt.identifier()).collect();
let set: HashSet<_> = HashSet::from_iter(&list);
assert_eq!(list.len(), set.len());
}
#[test]
fn assert_identifiers_are_valid() {
for option in ALL {
let identifier = option.identifier();
assert!(!identifier.is_empty());
let mut chars = identifier.chars();
let first = chars.next().expect("not empty");
assert!(first.is_alphabetic());
assert!(first.is_lowercase());
for char in chars {
assert!(char.is_alphanumeric() || char == '-');
if char.is_alphabetic() {
assert!(char.is_lowercase());
}
}
}
}
#[test]
fn assert_description_not_empty() {
for option in ALL {
assert!(!option.description().is_empty());
}
}
}