Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3be9952
commit 3c3326e
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package Ticket4365 | ||
model Top | ||
inner Real a; | ||
Sub1 s1; | ||
|
||
initial algorithm | ||
a := 0; | ||
|
||
algorithm | ||
when time > 1 then | ||
a := 1; | ||
end when; | ||
end Top; | ||
|
||
|
||
model Sub1 | ||
outer Real a; | ||
algorithm | ||
when time > 2 then | ||
a := 2; | ||
end when; | ||
end Sub1; | ||
|
||
end Ticket4365; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// name: Ticket4365.mos | ||
// keywords: equation,when,inner/outer | ||
// status: correct | ||
// | ||
// Test for handling of inner/outer in algorithms | ||
// | ||
|
||
loadFile("Ticket4365.mo"); getErrorString(); | ||
instantiateModel(Ticket4365.Top); getErrorString(); | ||
|
||
// Result: | ||
// true | ||
// "" | ||
// "class Ticket4365.Top | ||
// Real a; | ||
// initial algorithm | ||
// a := 0.0; | ||
// algorithm | ||
// when time > 2.0 then | ||
// a := 2.0; | ||
// end when; | ||
// algorithm | ||
// when time > 1.0 then | ||
// a := 1.0; | ||
// end when; | ||
// end Ticket4365.Top; | ||
// " | ||
// "" | ||
// endResult |