summaryrefslogtreecommitdiff
path: root/graphics/asymptote/tests/template/structTest.asy
blob: e961397e9fdc97757e1d6a3347f7760332485294 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
struct BareStruct {
  static string testName = "bare struct";
}
struct A {
  static int global = 17;
  int local = 3;
}
access 'template/imports/structTemplate'(T=A, Lib=BareStruct) as bareStruct;

struct NestedStruct {
  static string testName = "nested struct";
}
struct B {
  static struct C {
    static int global = 17;
    int local = 3;
  }
}
access 'template/imports/structTemplate'(T=B.C, Lib=NestedStruct)
    as nestedStruct;

struct InnerStruct {
  static string testName = "inner struct";
}
struct D {
  struct E {
    static int global = 17;
    int local = 3;
  }
}
D d;
access 'template/imports/structTemplate'(T=d.E, Lib=InnerStruct)
    as innerStruct;

struct DeeplyNestedStruct {
  static string testName = "deeply nested struct";
}

struct G {
  struct H {
    static struct I {
      static int global = 17;
      int local = 3;
    }
  }
}
G g;

access 'template/imports/structTemplate'(T=g.H.I, Lib=DeeplyNestedStruct)
    as deeplyNestedStruct;

struct ImportedStruct {
  static string testName = "imported struct";
}
access 'template/imports/notTemplate' as notTemplate;
access 'template/imports/structTemplate'(T=notTemplate.A, Lib=ImportedStruct)
    as importedStruct;

struct NestedImport {
  static string testName = "nested import";
}
access 'template/imports/notTemplate2' as notTemplate2;
access 'template/imports/structTemplate'(T=notTemplate2.b.A, Lib=NestedImport)
    as nestedImport;