/[ascend]/trunk/models/johnpye/extfn/extrelfor.a4c
ViewVC logotype

Contents of /trunk/models/johnpye/extfn/extrelfor.a4c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 758 - (show annotations) (download) (as text)
Thu Jul 13 01:15:58 2006 UTC (18 years ago) by johnpye
File MIME type: text/x-ascend
File size: 575 byte(s)
Some extfn test cases.
1 REQUIRE "atoms.a4l";
2 IMPORT "johnpye/extfn/extfntest";
3
4 (*
5 This tests external relations embedded directly inside a FOR loop.
6 This was disallowed by the original code... hopefully the new code fixs it.
7 *)
8 MODEL extrelfor;
9
10 x[1..3] IS_A factor;
11
12 FOR i IN [1..2] CREATE
13 do_it_nth: add_one(
14 x[i] : INPUT;
15 x[i+1] : OUTPUT
16 );
17 END FOR;
18
19 METHODS
20 METHOD specify;
21 FIX x[1];
22 END specify;
23
24 METHOD values;
25 x[1] := 1.0;
26 END values;
27
28 METHOD default_self;
29 RUN specify;
30 RUN values;
31 END default_self;
32
33 METHOD self_test;
34 ASSERT x[3] == 3.0;
35 END self_test;
36
37 END extrelfor;

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22