-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
General bugfix correction. Add synthetic unit tests.
- Loading branch information
1 parent
af0646e
commit e61d381
Showing
18 changed files
with
173 additions
and
61 deletions.
There are no files selected for viewing
Binary file not shown.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
-------------------------------------------------------------------------------- | ||
TEST-CASES [SCRIPT(<ROUNDS>)]* | ||
-------------------------------------------------------------------------------- | ||
(3) [synth1, <1, 4, 6, 11>] | ||
(4.1) [synth1, <2, 3, 8>] | ||
(4.2.a.i) [synth1, <7, 9>] | ||
(4.2.a.ii) [synth1, <3>] | ||
(4.2.b) [synth1, <2>] | ||
(4.3.c) [synth1, <5, 10>] | ||
(4.3.d) [synth1, <8>] | ||
(4.3.e) [synth2, <1>] | ||
(5.5) [synth1, <5>], [synth2, <1>] | ||
(spec1) [synth2, <1>] | ||
(spec2) [synth1, <12>] | ||
(spec3) [synth2, <1>] | ||
|
||
|
||
Test case explanation: | ||
3 - 1 winner in 1st round, elected by majority | ||
4.1 - More than 2 winners in 1st round (1st round tiebreaker) | ||
4.2.a.i - 1 winner in @1st round, sum of two first >50%, tie for second place | ||
4.2.a.ii - 1 winner in @1st round, sum of two first >50%, no tie for second place | ||
4.2.b - 1 winner in @1st round, sum of two first <= 50% | ||
4.3.c - 2 winners in @1st round, sum of two first >50% | ||
4.3.d - 2 winners in @1st round, sum of two first <=50%, sum of three first >50% | ||
4.3.e - 2 winners in @1st round, sum of two first <=50%, sum of three first <=50% | ||
5.5 - Presidential tie breaker (it will use all tiebreaker criteria) | ||
spec1 - Custom made criteria. Diminishing consequent preferential tiebreakers | ||
spec2 - Custom made criteria. 1st round without votes | ||
spec3 - Custom made criteria. 4.3.e + absolute tie breaker (tie in special second round) | ||
|
||
|
||
@1st round = 1st round + tiebreakers | ||
|
||
Notes: | ||
- On the synthetic tests, the presidential choice is always the first one. | ||
- The rest of the rounds of synth2 have not been checked because they are not necessary | ||
to check all the cases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CS,1,2,3,4,5,6,7,8 | ||
Candidate A,1,1,1,1,1,1,1,1 | ||
Candidate B,2,2,3,3,4,4,5,5 | ||
Candidate C,3,3,4,4,2,2,6,7 | ||
Candidate D,4,4,2,2,3,3,7,6 | ||
Candidate E,5,5,5,6,6,6,2,3 | ||
Candidate F,6,6,6,5,5,5,3,2 | ||
Candidate G,7,8,8,8,8,8,4,4 | ||
Candidate H,,7,7,,,,, | ||
Candidate I,,,,7,7,,, | ||
Candidate J,,,,,,7,8, | ||
Candidate K,8,,,,,,,8 | ||
Candidate L,,,,,,,, | ||
Candidate M,,,,,,,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
CS,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34 | ||
Candidate A,1,1,1,1,2,,,,2,,,,,,,,2,2,,,2,,,,2,2,,,,,,,, | ||
Candidate B,2,2,,,1,1,1,1,,,,,,,,,,,2,2,,2,,,,,2,2,,,,,, | ||
Candidate C,,,2,,,2,,,1,1,1,1,,,2,2,,,,,,,2,,,,,,2,2,,,, | ||
Candidate D,,,,,,,,,,,,,1,1,1,1,,,,,,,,2,,,,,,,2,2,, | ||
Candidate E,,,,,,,,,,,,,,,,,1,1,1,1,,,,,,,,,,,,,2,2 | ||
Candidate F,,,,,,,,,,,,,,,,,,,,,1,1,1,1,,,,,,,,,, | ||
Candidate G,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,,,,,,, | ||
Candidate H,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1,,,, | ||
Candidate I,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,1,1, | ||
Candidate J,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1 | ||
Candidate K,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, | ||
Candidate L,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, | ||
Candidate M,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.