Skip to content

Commit

Permalink
Added additional sort tests
Browse files Browse the repository at this point in the history
  • Loading branch information
folkengine committed Jan 21, 2022
1 parent 6603a88 commit f094c12
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,6 @@ internationalization. Current languages supported are

* [Hanafuda](https://en.wikipedia.org/wiki/Hanafuda)
* [고스톱 (Go-Stop)](https://en.wikipedia.org/wiki/Go-Stop)
* [Go-Stop - The Cards](https://www.sloperama.com/gostop/cards.html)
* [nbry/go-stop-rust](https://github.com/nbry/go-stop-rust)
* [Sakura](https://en.wikipedia.org/wiki/Sakura_(card_game))
11 changes: 11 additions & 0 deletions src/cards/pile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,17 @@ mod pile_tests {
assert_eq!("2♠ 2♥ 2♣ A♠ A♦", actual.to_symbol_index())
}

#[test]
fn sort_by_frequency__straight() {
let pile = Pile::french_deck()
.pile_by_index(&["8C", "AD", "2H", "4H", "9S"])
.unwrap();

let actual = pile.sort_by_frequency();

assert_eq!("A♦ 9♠ 8♣ 4♥ 2♥", actual.to_symbol_index())
}

#[test]
fn suits() {
let deck = Pile::french_deck();
Expand Down

0 comments on commit f094c12

Please sign in to comment.