Skip to content

Commit

Permalink
new test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanohar committed Jul 17, 2024
1 parent 68b70cc commit 0e8a47d
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/102.act
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
deftype str (int<4> x)
{
methods {
macro plus (int<2> y) : int<4>
function plus (int<2> y) : int<4>
{
self := x + y
chp { self := x + y }
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions test/103.act
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
deftype str (int<4> x, z)
{
methods {
function plus (int<2> y) : int<4>
{
chp { self := x + y }
}
}
}

defproc test()
{
str s;
chp {
s.x := 3;
s.z := 1;
log ("got ", int(s))
}
}

test t;
22 changes: 22 additions & 0 deletions test/104.act
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
deftype str (int<4> x, z)
{
methods {
function plus (int<2> y) : int<4>
{
chp { self := x + y }
}
}
}

defproc test()
{
str s;
int<8> w;
chp {
w := 0x42;
s := str(0x42);
log ("got ", s.x, " ", s.z)
}
}

test t;
1 change: 1 addition & 0 deletions test/runs/103.act.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WARNING: test<>: substituting chp model (requested prs, not found)
1 change: 1 addition & 0 deletions test/runs/103.act.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ 20] <> got 49
1 change: 1 addition & 0 deletions test/runs/104.act.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
WARNING: test<>: substituting chp model (requested prs, not found)
1 change: 1 addition & 0 deletions test/runs/104.act.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ 20] <> got 4 2

0 comments on commit 0e8a47d

Please sign in to comment.