diff --git a/tests/main.rs b/tests/main.rs new file mode 100644 index 0000000..bffea09 --- /dev/null +++ b/tests/main.rs @@ -0,0 +1,19 @@ +/* OpenTally: Open-source election vote counting + * Copyright © 2021 Lee Yingtong Li (RunasSudo) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +mod utils; +mod tests_impl; diff --git a/tests/act.rs b/tests/tests_impl/act.rs similarity index 98% rename from tests/act.rs rename to tests/tests_impl/act.rs index f2c2f8a..0b891f5 100644 --- a/tests/act.rs +++ b/tests/tests_impl/act.rs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -mod utils; +use crate::utils; use opentally::numbers::Rational; use opentally::stv; diff --git a/tests/aec.rs b/tests/tests_impl/aec.rs similarity index 99% rename from tests/aec.rs rename to tests/tests_impl/aec.rs index 160acde..83bfffd 100644 --- a/tests/aec.rs +++ b/tests/tests_impl/aec.rs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -mod utils; +use crate::utils; use opentally::election::Election; use opentally::numbers::Rational; diff --git a/tests/cambridge.rs b/tests/tests_impl/cambridge.rs similarity index 98% rename from tests/cambridge.rs rename to tests/tests_impl/cambridge.rs index 46dd7ca..0b321f9 100644 --- a/tests/cambridge.rs +++ b/tests/tests_impl/cambridge.rs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -mod utils; +use crate::utils; use opentally::numbers::Rational; use opentally::stv; diff --git a/tests/cli.rs b/tests/tests_impl/cli.rs similarity index 100% rename from tests/cli.rs rename to tests/tests_impl/cli.rs diff --git a/tests/coe.rs b/tests/tests_impl/coe.rs similarity index 98% rename from tests/coe.rs rename to tests/tests_impl/coe.rs index 82ebab4..60c6542 100644 --- a/tests/coe.rs +++ b/tests/tests_impl/coe.rs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -mod utils; +use crate::utils; use opentally::numbers::Rational; use opentally::stv; diff --git a/tests/constraints.rs b/tests/tests_impl/constraints.rs similarity index 99% rename from tests/constraints.rs rename to tests/tests_impl/constraints.rs index 7445e61..39ea9bc 100644 --- a/tests/constraints.rs +++ b/tests/tests_impl/constraints.rs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -mod utils; +use crate::utils; use opentally::constraints::Constraints; use opentally::election::{CandidateState, CountState, Election}; diff --git a/tests/convert.rs b/tests/tests_impl/convert.rs similarity index 100% rename from tests/convert.rs rename to tests/tests_impl/convert.rs diff --git a/tests/csm.rs b/tests/tests_impl/csm.rs similarity index 98% rename from tests/csm.rs rename to tests/tests_impl/csm.rs index 5575d4d..76a2c56 100644 --- a/tests/csm.rs +++ b/tests/tests_impl/csm.rs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -mod utils; +use crate::utils; use opentally::numbers::NativeFloat64; use opentally::stv; diff --git a/tests/equal_ranks.rs b/tests/tests_impl/equal_ranks.rs similarity index 100% rename from tests/equal_ranks.rs rename to tests/tests_impl/equal_ranks.rs diff --git a/tests/ers.rs b/tests/tests_impl/ers.rs similarity index 99% rename from tests/ers.rs rename to tests/tests_impl/ers.rs index 5f5a8fd..18478c2 100644 --- a/tests/ers.rs +++ b/tests/tests_impl/ers.rs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -mod utils; +use crate::utils; use opentally::numbers::Rational; use opentally::stv; diff --git a/tests/meek.rs b/tests/tests_impl/meek.rs similarity index 99% rename from tests/meek.rs rename to tests/tests_impl/meek.rs index 0fa5866..11df147 100644 --- a/tests/meek.rs +++ b/tests/tests_impl/meek.rs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -mod utils; +use crate::utils; use opentally::election::{CandidateState, CountState, Election}; use opentally::numbers::{Fixed, NativeFloat64, Number}; diff --git a/tests/minneapolis.rs b/tests/tests_impl/minneapolis.rs similarity index 99% rename from tests/minneapolis.rs rename to tests/tests_impl/minneapolis.rs index cdf0c61..e5dcd40 100644 --- a/tests/minneapolis.rs +++ b/tests/tests_impl/minneapolis.rs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -mod utils; +use crate::utils; use opentally::numbers::Rational; use opentally::stv; diff --git a/tests/tests_impl/mod.rs b/tests/tests_impl/mod.rs new file mode 100644 index 0000000..edafb79 --- /dev/null +++ b/tests/tests_impl/mod.rs @@ -0,0 +1,32 @@ +/* OpenTally: Open-source election vote counting + * Copyright © 2021 Lee Yingtong Li (RunasSudo) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +mod act; +mod aec; +mod cambridge; +mod cli; +mod coe; +mod constraints; +mod convert; +mod csm; +mod equal_ranks; +mod ers; +mod meek; +mod minneapolis; +mod prsa; +mod scotland; +mod special_cases; diff --git a/tests/prsa.rs b/tests/tests_impl/prsa.rs similarity index 98% rename from tests/prsa.rs rename to tests/tests_impl/prsa.rs index e003044..72a2e2e 100644 --- a/tests/prsa.rs +++ b/tests/tests_impl/prsa.rs @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -mod utils; +use crate::utils; use opentally::numbers::Rational; use opentally::stv; diff --git a/tests/scotland.rs b/tests/tests_impl/scotland.rs similarity index 100% rename from tests/scotland.rs rename to tests/tests_impl/scotland.rs diff --git a/tests/special_cases.rs b/tests/tests_impl/special_cases.rs similarity index 99% rename from tests/special_cases.rs rename to tests/tests_impl/special_cases.rs index bd8c086..172f9b2 100644 --- a/tests/special_cases.rs +++ b/tests/tests_impl/special_cases.rs @@ -15,8 +15,6 @@ * along with this program. If not, see . */ -mod utils; - use opentally::election::{CandidateState, CountState, Election}; use opentally::numbers::Rational; use opentally::parser::blt;