mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-11-28 01:01:53 +03:00
fix tests
This commit is contained in:
parent
77e2d55765
commit
e7091b18ed
@ -1,3 +1,3 @@
|
||||
function main(a: u8[3]) {
|
||||
function main(a: [u8; 3]) {
|
||||
console.assert(a == [1u8; 3]);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u8[3]) {
|
||||
function main(a: [u8; 3]) {
|
||||
console.assert(a == [1u8; -3]);
|
||||
}
|
@ -1,3 +1,3 @@
|
||||
function main(a: u8[3]) {
|
||||
function main(a: [u8; 3]) {
|
||||
console.assert(a == [1u8, 1u8, 1u8]);
|
||||
}
|
@ -1,2 +1,2 @@
|
||||
[registers]
|
||||
r: u8[3] = [1u8, 1u8, 1u8];
|
||||
r: [u8; 3] = [1u8, 1u8, 1u8];
|
||||
|
@ -1,2 +1,2 @@
|
||||
[registers]
|
||||
r: u8[3] = [0u8, 0u8, 0u8];
|
||||
r: [u8; 3] = [0u8, 0u8, 0u8];
|
||||
|
@ -1,2 +1,2 @@
|
||||
[main]
|
||||
a: u8[3][2] = [[0; 3]; 2];
|
||||
a: [u8; (3, 2)] = [[0; 3]; 2];
|
@ -1,2 +1,2 @@
|
||||
[main]
|
||||
a: u8[3] = [1, 1, 1];
|
||||
a: [u8; 3] = [1, 1, 1];
|
@ -2,7 +2,7 @@
|
||||
function main() {
|
||||
const a = [[0u32, 0u32, 0u32], [0u32, 0u32, 0u32]]; // inline
|
||||
|
||||
const b: u32[3][2] = [[0; 3]; 2]; // initializer
|
||||
const b: [u32; (3, 2)] = [[0; 3]; 2]; // initializer
|
||||
|
||||
console.assert(a == b);
|
||||
}
|
@ -1,2 +1,2 @@
|
||||
[registers]
|
||||
r: u8[3] = [1u8, 1u8, 1u8];
|
||||
r: [u8; (3)] = [1u8, 1u8, 1u8];
|
||||
|
@ -1,2 +1,2 @@
|
||||
[registers]
|
||||
r: u8[3] = [0u8, 0u8, 0u8];
|
||||
r: [u8; (3)] = [0u8, 0u8, 0u8];
|
||||
|
@ -1,3 +1,3 @@
|
||||
function main(input) -> u8[3] {
|
||||
function main(input) -> [u8; 3] {
|
||||
return input.registers.r
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
// `{from}..{to}` copies the elements of one array into another exclusively
|
||||
function main(a: u8[3]) {
|
||||
function main(a: [u8; 3]) {
|
||||
let b = [1u8; 4];
|
||||
|
||||
console.assert(a == b[0..3]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
// A spread operator `...` copies the elements of one array into another
|
||||
function main(a: u8[3]) {
|
||||
function main(a: [u8; 3]) {
|
||||
let b = [1u8, 1u8];
|
||||
|
||||
console.assert(a == [1u8, ...b]);
|
||||
|
@ -1,3 +1,3 @@
|
||||
let main() {
|
||||
let a: u32[-2] = [0u32; 2];
|
||||
let a: [u8; -2] = [0u32; 2];
|
||||
}
|
@ -207,11 +207,12 @@ impl fmt::Display for Type {
|
||||
Type::Circuit(ref variable) => write!(f, "circuit {}", variable),
|
||||
Type::SelfType => write!(f, "SelfType"),
|
||||
Type::Array(ref array, ref dimensions) => {
|
||||
write!(f, "{}", *array)?;
|
||||
for row in dimensions {
|
||||
write!(f, "[{}]", row)?;
|
||||
}
|
||||
write!(f, "")
|
||||
let dimensions = dimensions
|
||||
.iter()
|
||||
.map(|x| format!("{}", x))
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ");
|
||||
write!(f, "[{}; ({})]", *array, dimensions)
|
||||
}
|
||||
Type::Tuple(ref tuple) => {
|
||||
let types = tuple.iter().map(|x| format!("{}", x)).collect::<Vec<_>>().join(", ");
|
||||
|
Loading…
Reference in New Issue
Block a user