Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standard test suite for pascals-triangle (#362)
In surveying the current implementations, I found 2 main approaches: - Test 1, 2, 3, 4, 5 and 20 without any boundary checking - [Ruby](https://github.com/exercism/xruby/blob/e50b1cbeabc3a82c1ed7800da112b0984dbbf01c/exercises/pascals-triangle/pascals_triangle_test.rb) is a good example - Test 4 & 6 rows, and test boundaries - [Kotlin](https://github.com/exercism/xkotlin/blob/02ecc5a70719f0b0e741992f33879f880f7c407f/exercises/pascals-triangle/src/test/kotlin/PascalsTriangleTest.kt) is a good example Also, some languages exposed specific functions for `rows` and `last_row` while some relied on built-in functions for this behavior. In this approach I'm trying to meld what I see as the best of these worlds. Rows function ____ I think these functions should be implemented by the students, so I'm highlighting them as functions to test We decided that `last_row` functions were not necessary, since they would mostly only alias existing language functions (`pop`, `last`, etc.) Fewer Tests ---- Once a student has gotten 4 rows to work the probably have the algorithm down. No real reason to test larger numbers that I can see. Test Boundaries ---- An upper-limit test seemed unnecessary and very language-dependent. But catching Nil and negative inputs seemed like useful things to test.
- Loading branch information