Skip to content
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 problemreductions-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ mod tests {
panic!("expected create command");
};

assert_eq!(args.problem, "BiconnectivityAugmentation");
assert_eq!(args.problem.as_deref(), Some("BiconnectivityAugmentation"));
assert_eq!(args.graph.as_deref(), Some("0-1,1-2"));
assert_eq!(args.potential_edges.as_deref(), Some("0-2:3,1-3:5"));
assert_eq!(args.budget.as_deref(), Some("7"));
Expand Down
35 changes: 29 additions & 6 deletions problemreductions-cli/src/commands/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ fn type_format_hint(type_name: &str, graph_type: Option<&str>) -> &'static str {
"Vec<Vec<usize>>" => "semicolon-separated groups: \"0,1;2,3\"",
"usize" | "W::Sum" => "integer",
"u64" => "integer",
"Vec<u64>" => "comma-separated integers: 0,0,5",
"i64" => "integer",
"BigUint" => "nonnegative decimal integer",
"Vec<BigUint>" => "comma-separated nonnegative decimal integers: 3,7,1,8",
Expand Down Expand Up @@ -2515,6 +2514,7 @@ fn create_random(

#[cfg(test)]
mod tests {
use super::*;
use super::problem_help_flag_name;

#[test]
Expand All @@ -2537,18 +2537,21 @@ mod tests {
"num-paths-required"
);
}
}

#[cfg(test)]
mod tests {
use super::*;

fn empty_args() -> CreateArgs {
CreateArgs {
problem: "BiconnectivityAugmentation".to_string(),
problem: Some("BiconnectivityAugmentation".to_string()),
example: None,
example_target: None,
example_side: crate::cli::ExampleSide::Source,
graph: None,
weights: None,
edge_weights: None,
capacities: None,
source: None,
sink: None,
num_paths_required: None,
couplings: None,
fields: None,
clauses: None,
Expand All @@ -2564,10 +2567,17 @@ mod tests {
n: None,
positions: None,
radius: None,
source_1: None,
sink_1: None,
source_2: None,
sink_2: None,
requirement_1: None,
requirement_2: None,
sizes: None,
capacity: None,
sequence: None,
sets: None,
partition: None,
universe: None,
biedges: None,
left: None,
Expand All @@ -2576,10 +2586,23 @@ mod tests {
basis: None,
target_vec: None,
bounds: None,
release_times: None,
lengths: None,
terminals: None,
tree: None,
required_edges: None,
bound: None,
pattern: None,
strings: None,
arcs: None,
potential_edges: None,
budget: None,
deadlines: None,
precedence_pairs: None,
task_lengths: None,
deadline: None,
num_processors: None,
alphabet_size: None,
}
}

Expand Down
Loading