Add tests

This commit is contained in:
Pranav Gaddamadugu 2023-10-21 12:15:33 -04:00
parent b6851a9cd8
commit af2447aa02
4 changed files with 53 additions and 1 deletions

View File

@ -0,0 +1,15 @@
/*
namespace: Compile
expectation: Pass
*/
program test.aleo {
transition foo(a: [bool; 8]) -> [bool; 8] {
if a[0u32] {
a[1u32] = false;
} else {
a[1u32] = true;
}
return a;
}
}

View File

@ -0,0 +1,13 @@
/*
namespace: Compile
expectation: Pass
*/
program test.aleo {
transition foo(a: [bool; 8]) -> [bool; 8] {
for i: u8 in 0u8..8u8 {
a[i] = false;
}
return a;
}
}

View File

@ -1,6 +1,6 @@
/*
namespace: Compile
expectation: Fail
expectation: Pass
*/
program test.aleo {

View File

@ -0,0 +1,24 @@
/*
namespace: Execute
expectation: Pass
cases:
matrix_multiply:
- input:
- "[1u64, 2u64, 3u64, 4u64, 5u64, 6u64, 7u64, 8u64, 9u64]"
- "[1u64, 2u64, 3u64, 4u64, 5u64, 6u64, 7u64, 8u64, 9u64]"
*/
program test.aleo {
transition matrix_multiply(a: [[u64; 3]; 3], b: [[u64; 3]; 3]) -> [[u64; 3]; 3] {
let mut result: [[u64; 3]; 3] = [[0u64; 3]; 3];
for i: u8 in 0u8..3u8 {
for j: u8 in 0u8..3u8 {
for k: u8 in 0u8..3u8 {
result[i][j] += a[i][k] * b[k][j];
}
}
}
return result;
}
}