diff options
Diffstat (limited to 'graphics/asymptote/tests/template/imports/structTemplate.asy')
-rw-r--r-- | graphics/asymptote/tests/template/imports/structTemplate.asy | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/graphics/asymptote/tests/template/imports/structTemplate.asy b/graphics/asymptote/tests/template/imports/structTemplate.asy new file mode 100644 index 0000000000..5894d2e280 --- /dev/null +++ b/graphics/asymptote/tests/template/imports/structTemplate.asy @@ -0,0 +1,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(); |