summaryrefslogtreecommitdiff
path: root/graphics/asymptote/tests/template/imports/structTemplate.asy
blob: 5894d2e280b3cef8a4c370daf70bb468b64a56d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Assumption: T is a struct with a static int `global` and a non-static int
// `local`. Lib is a struct with a static string `testName`.
typedef import(T, Lib);
import TestLib;

StartTest('Accessing static testName');
Lib.testName;
EndTest();

StartTest(Lib.testName + ': new');
new T;
EndTest();

StartTest(Lib.testName + ': Unspecified Declaration');
T a;
EndTest();

StartTest(Lib.testName + ': Initializing to null');
T b = null;
EndTest();

StartTest(Lib.testName + ': Initializing to new');
T c = new T;
EndTest();

StartTest(Lib.testName + ': Access static member');
int d = T.global;
EndTest();

StartTest(Lib.testName + ': Access non-static member');
int e = c.local;
EndTest();

StartTest(Lib.testName + ': Access static member from instance');
int f = c.global;
EndTest();