src/test/01-Basic/268-foreach-auto-multidim.ck
raw| 1 | // tests 1) nested foreach with 2) auto |
| 2 | // unit test was introduced in 1.5.4.4 |
| 3 | // related: https://github.com/ccrma/chuck/issues/441 |
| 4 | |
| 5 | // a multidimensional array |
| 6 | [[ 1, 2], [3, 4, 5], [6], [7, 8]] @=> int grid[][]; |
| 7 | |
| 8 | // nest foreach loops with auto |
| 9 | for( auto arr: grid ) |
| 10 | { |
| 11 | for( auto val: arr ) |
| 12 | { |
| 13 | <<< val >>>; |
| 14 | } |
| 15 | } |