1
0
mirror of https://github.com/gryf/tagbar.git synced 2026-02-21 09:15:56 +01:00

Add tests to repository

This commit is contained in:
Jan Larres
2013-03-28 00:16:03 +13:00
parent b6f47e4020
commit db9404ca1a
128 changed files with 54624 additions and 0 deletions

60
tests/vera/properties.vr Normal file
View File

@@ -0,0 +1,60 @@
class A {
public integer data;
local integer addr;
protected integer cmd;
static integer credits;
task new() {
data = 100;
addr = 200;
cmd = 1;
credits = 10;
}
task printA() {
printf ("value of data %0d in A\n", data);
printf ("value of addr %0d in A\n", addr);
printf ("value of cmd %0d in A\n", cmd);
}
}
class B extends A {
task printB() {
printf ("value of data %0d in B\n", data);
// Below line will give compile error
//printf ("value of addr %0d in B\n", addr);
printf ("value of cmd %0d in B\n", cmd);
}
}
class C {
A a;
B b;
task new() {
a = new();
b = new();
b.data = 2;
}
task printC() {
printf ("value of data %0d in C\n", a.data);
printf ("value of data %0d in C\n", b.data);
// Below line will give compile error
//printf ("value of addr %0d in C\n", a.addr);
//printf ("value of cmd %0d in C\n", a.cmd);
//printf ("value of addr %0d in C\n", b.addr);
//printf ("value of cmd %0d in C\n", b.cmd);
}
}
program properties {
C c = new();
c.a.printA();
c.b.printB();
c.printC();
printf("value of credits is %0d\n",c.a.credits);
printf("value of credits is %0d\n",c.b.credits);
c.a.credits ++;
printf("value of credits is %0d\n",c.a.credits);
printf("value of credits is %0d\n",c.b.credits);
c.b.credits ++;
printf("value of credits is %0d\n",c.a.credits);
printf("value of credits is %0d\n",c.b.credits);
}