diff --git a/arrays.go b/arrays.go index 6742f2f..fea95db 100644 --- a/arrays.go +++ b/arrays.go @@ -1,8 +1,16 @@ package go_koans -var __string__ string +var __string__ string = "impossibly lame value" +var __int__ int = -1 func testArrays() { - fruits := [3]string{"apple", "orange"} - assert(fruits[0] == __string__) + fruits := [4]string{"apple", "orange", "mango"} + + assert(fruits[0] == __string__) // indexes begin at 0 + assert(fruits[1] == __string__) // one is indeed the loneliest number + assert(fruits[2] == __string__) // it takes two to ...tango? + assert(fruits[3] == __string__) // there is no spoon + + assert(len(fruits) == __int__) // the length is what the length is + assert(cap(fruits) == __int__) // it can hold no more }