translator: add big test for bytearray

This commit is contained in:
Alexey Stepanov
2016-08-23 09:44:41 +03:00
parent 92579f1203
commit c99d4e35df
2 changed files with 19 additions and 1 deletions
@@ -1 +1,2 @@
bytearray_1_Byte(123) == 123
bytearray_1_array() == 1
@@ -3,4 +3,21 @@ fun bytearray_1(x: Byte): Byte {
z.set(1, x)
val r = z.clone()
return r.get(1)
}
}
fun bytearray_1_array(): Int {
val size = 256
val z= ByteArray(size)
var ind = 0
while(ind < size){
z[ind] = ind.toByte()
ind +=1
}
val newInstance = z.clone()
ind = 0
while(ind < size){
assert(newInstance[ind] == ind.toByte())
ind += 1
}
return 1
}