Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
Signed-off-by: Vassily Litvinov <[email protected]>
  • Loading branch information
vasslitvinov committed Mar 8, 2024
1 parent 9e9e65d commit e4dca01
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/domains/compilerErrors/rect-mismatch-type-1.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// related: test/arrays/deitz/part5/test_array_uint2.chpl

var DnsStencDom = {-1:int(8)..1:int(8), -1:int(8)..1:int(8)};
DnsStencDom = (-1..0, -1..0); // error: int8 <- int64
1 change: 1 addition & 0 deletions test/domains/compilerErrors/rect-mismatch-type-1.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rect-mismatch-type-1.chpl:4: error: index type mismatch in domain assignment
3 changes: 3 additions & 0 deletions test/domains/compilerErrors/sparseSubdom-mismatch-1.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
use List;
const dr = {1:int(8)..8:int(8)};
const sd: sparse subdomain(dr) = new list(int); // error: int8 <- int64
1 change: 1 addition & 0 deletions test/domains/compilerErrors/sparseSubdom-mismatch-1.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sparseSubdom-mismatch-1.chpl:3: error: cannot add a int(64) to a sparse 1-dim domain with idxType int(8)
3 changes: 3 additions & 0 deletions test/domains/compilerErrors/sparseSubdom-mismatch-2.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

const dr = {1:int(8)..8:int(8)};
const sd: sparse subdomain(dr) = 2; // error: domain <- int
1 change: 1 addition & 0 deletions test/domains/compilerErrors/sparseSubdom-mismatch-2.good
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sparseSubdom-mismatch-2.chpl:3: error: assigning int(64) to an irregular domain

0 comments on commit e4dca01

Please sign in to comment.