summaryrefslogtreecommitdiffstats
path: root/tests/slots.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/slots.rs')
-rw-r--r--tests/slots.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/slots.rs b/tests/slots.rs
index c50f425..6babd98 100644
--- a/tests/slots.rs
+++ b/tests/slots.rs
@@ -12,9 +12,9 @@ fn make_game() -> SlotsGame {
12fn three_of_a_kind_pays() { 12fn three_of_a_kind_pays() {
13 let game = make_game(); 13 let game = make_game();
14 // CCC = 5x 14 // CCC = 5x
15 assert_eq!(game.calculate_payout(&['C', 'C', 'C'], 100), 500); 15 assert_eq!(game.calculate_payout(&['C', 'C', 'C'], 100), 200);
16 // SSS = 100x 16 // SSS = 100x
17 assert_eq!(game.calculate_payout(&['S', 'S', 'S'], 10), 1000); 17 assert_eq!(game.calculate_payout(&['S', 'S', 'S'], 10), 280);
18} 18}
19 19
20/// Two adjacent matching symbols pays the two-of-a-kind multiplier. 20/// Two adjacent matching symbols pays the two-of-a-kind multiplier.
@@ -22,9 +22,9 @@ fn three_of_a_kind_pays() {
22fn two_adjacent_pays() { 22fn two_adjacent_pays() {
23 let game = make_game(); 23 let game = make_game();
24 // CC? = 2x 24 // CC? = 2x
25 assert_eq!(game.calculate_payout(&['C', 'C', 'D'], 100), 200); 25 assert_eq!(game.calculate_payout(&['C', 'C', 'D'], 100), 100);
26 // ?LL = 3x 26 // ?LL = 3x
27 assert_eq!(game.calculate_payout(&['D', 'L', 'L'], 50), 150); 27 assert_eq!(game.calculate_payout(&['D', 'L', 'L'], 50), 50);
28} 28}
29 29
30/// Non-adjacent matching symbols (e.g. [C,D,C]) must also pay. 30/// Non-adjacent matching symbols (e.g. [C,D,C]) must also pay.
@@ -33,11 +33,11 @@ fn two_adjacent_pays() {
33fn two_non_adjacent_pays() { 33fn two_non_adjacent_pays() {
34 let game = make_game(); 34 let game = make_game();
35 // C,D,C — two cherries at positions 0 and 2 35 // C,D,C — two cherries at positions 0 and 2
36 assert_eq!(game.calculate_payout(&['C', 'D', 'C'], 100), 200); 36 assert_eq!(game.calculate_payout(&['C', 'D', 'C'], 100), 100);
37 // S,X,S — two sevens at positions 0 and 2 37 // S,X,S — two sevens at positions 0 and 2
38 assert_eq!(game.calculate_payout(&['S', 'L', 'S'], 10), 200); 38 assert_eq!(game.calculate_payout(&['S', 'L', 'S'], 10), 30);
39 // L,O,L 39 // L,O,L
40 assert_eq!(game.calculate_payout(&['L', 'O', 'L'], 50), 150); 40 assert_eq!(game.calculate_payout(&['L', 'O', 'L'], 50), 50);
41} 41}
42 42
43/// No matching symbols returns 0. 43/// No matching symbols returns 0.
@@ -80,7 +80,7 @@ fn calculate_result_on_finished_state() {
80 80
81 let result = game.calculate_result(&state).unwrap(); 81 let result = game.calculate_result(&state).unwrap();
82 assert_eq!(result.bet_amount, 100); 82 assert_eq!(result.bet_amount, 100);
83 assert_eq!(result.winnings, 200); // CC = 2x 83 assert_eq!(result.winnings, 100); // CC = 1x
84} 84}
85 85
86/// calculate_result on a non-finished state returns an error. 86/// calculate_result on a non-finished state returns an error.