From 5d491687b466bf474bf1bc18bf684e57e9e62dd5 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sat, 12 Jun 2021 21:16:53 +1000 Subject: [PATCH] Code fixups --- src/main.rs | 4 +++- tests/aec.rs | 1 + tests/ers97.rs | 1 + tests/prsa.rs | 1 + tests/scotland.rs | 1 + 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c70dbf6..76bf629 100644 --- a/src/main.rs +++ b/src/main.rs @@ -82,6 +82,7 @@ struct STV { #[clap(help_heading=Some("ROUNDING"), long, value_name="dps")] round_quota: Option, + /// How to calculate votes to credit to candidates in surplus transfers #[clap(help_heading=Some("ROUNDING"), long, possible_values=&["single_step", "by_value", "per_ballot"], default_value="single_step", value_name="mode")] sum_surplus_transfers: String, @@ -96,7 +97,7 @@ struct STV { #[clap(help_heading=Some("QUOTA"), short='c', long, possible_values=&["geq", "gt"], default_value="gt", value_name="criterion")] quota_criterion: String, - // Whether to apply a form of progressive quota + /// Whether to apply a form of progressive quota #[clap(help_heading=Some("QUOTA"), long, possible_values=&["static", "ers97"], default_value="static", value_name="mode")] quota_mode: String, @@ -107,6 +108,7 @@ struct STV { #[clap(help_heading=Some("STV VARIANTS"), short='s', long, possible_values=&["wig", "uig", "eg", "meek"], default_value="wig", value_name="method")] surplus: String, + /// Order to distribute surpluses #[clap(help_heading=Some("STV VARIANTS"), long, possible_values=&["by_size", "by_order"], default_value="by_size", value_name="order")] surplus_order: String, diff --git a/tests/aec.rs b/tests/aec.rs index dafa3d8..da1a0ae 100644 --- a/tests/aec.rs +++ b/tests/aec.rs @@ -60,6 +60,7 @@ fn aec_tas19_rational() { round_votes: Some(0), round_quota: Some(0), sum_surplus_transfers: stv::SumSurplusTransfersMode::SingleStep, + normalise_ballots: false, quota: stv::QuotaType::Droop, quota_criterion: stv::QuotaCriterion::GreaterOrEqual, quota_mode: stv::QuotaMode::Static, diff --git a/tests/ers97.rs b/tests/ers97.rs index b7fd519..f665645 100644 --- a/tests/ers97.rs +++ b/tests/ers97.rs @@ -34,6 +34,7 @@ fn ers97_rational() { round_votes: Some(2), round_quota: Some(2), sum_surplus_transfers: stv::SumSurplusTransfersMode::SingleStep, + normalise_ballots: false, quota: stv::QuotaType::DroopExact, quota_criterion: stv::QuotaCriterion::GreaterOrEqual, quota_mode: stv::QuotaMode::ERS97, diff --git a/tests/prsa.rs b/tests/prsa.rs index c47e778..144aa29 100644 --- a/tests/prsa.rs +++ b/tests/prsa.rs @@ -28,6 +28,7 @@ fn prsa1_rational() { round_votes: Some(3), round_quota: Some(3), sum_surplus_transfers: stv::SumSurplusTransfersMode::SingleStep, + normalise_ballots: false, quota: stv::QuotaType::Droop, quota_criterion: stv::QuotaCriterion::GreaterOrEqual, quota_mode: stv::QuotaMode::Static, diff --git a/tests/scotland.rs b/tests/scotland.rs index dd6a40e..098114c 100644 --- a/tests/scotland.rs +++ b/tests/scotland.rs @@ -35,6 +35,7 @@ fn scotland_linn07_fixed5() { round_votes: None, round_quota: Some(0), sum_surplus_transfers: stv::SumSurplusTransfersMode::PerBallot, + normalise_ballots: true, quota: stv::QuotaType::Droop, quota_criterion: stv::QuotaCriterion::GreaterOrEqual, quota_mode: stv::QuotaMode::Static,