()
| 2 | |
| 3 | #[test] |
| 4 | fn make_changes() { |
| 5 | let coins = vec![1, 2, 5]; |
| 6 | //(min coins, amount) |
| 7 | let solutions = vec![ |
| 8 | (3, 11), |
| 9 | (3, 12), |
| 10 | (4, 13), |
| 11 | (4, 14), |
| 12 | (3, 15), |
| 13 | (4, 16), |
| 14 | (4, 17), |
| 15 | (5, 18), |
| 16 | (5, 19), |
| 17 | (4, 20), |
| 18 | ]; |
| 19 | for (expect, amount) in solutions { |
| 20 | assert_eq!(expect, dp::coin::make_change_classic(&coins, amount)); |
| 21 | assert_eq!(expect, dp::coin::make_change_iter(&coins, amount)); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | #[test] |
| 26 | fn make_changes_fail() { |
nothing calls this directly
no outgoing calls
no test coverage detected