translator: add big test for bytearray
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user