Skip to content

Commit

Permalink
Add tests covering remaining failing coercions.
Browse files Browse the repository at this point in the history
  • Loading branch information
tgehr committed Apr 6, 2023
1 parent b5561b1 commit 053a329
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/coerceIntLengthMismatch.slq
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

def main(){
n:=2,m:=3;
x:=0:int[n];
y:=x coerce int[m]; // error
// (need to go through vector)
}
6 changes: 6 additions & 0 deletions test/coerceIntToVecLengthMismatch.slq
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

def main(){
n:=2,m:=3;
x:=0:int[n];
y:=x coerce 𝔹^m; // TODO: crash at runtime
}
7 changes: 7 additions & 0 deletions test/coerceVecToIntLengthMismatch.slq
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// args: --run

def main(){
n:=2,m:=3;
x:=vector(n,0:𝔹);
y:=x coerce int[m]; // error
}
8 changes: 8 additions & 0 deletions test/coerceVectorLengthMismatch.slq
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// args: --run

def main(){
n:=2;
x:=vector(n,0:!𝔹);
m:=3;
y:=x coerce !𝔹^m; // error
}

0 comments on commit 053a329

Please sign in to comment.