Skip to content

Commit c793a9c

Browse files
committed
Added some tests with bugs.
1 parent 9dfce19 commit c793a9c

3 files changed

Lines changed: 66 additions & 3 deletions

File tree

tests/issue1/main.aq

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,51 @@
1-
import "./f1/f2/f3/test.aq" test;
1+
class test{
2+
static auto test_global_var = "SUCCESS";
3+
4+
static auto test_function = func(){
5+
__builtin_print("lambda test OK.\n\n\n");
6+
}
7+
8+
class test_class {
9+
void test_class(){
10+
__builtin_print("OK");
11+
}
12+
13+
auto test_var = "TEST_VAR";
14+
15+
class TEST_CLASS_IN_CLASS{
16+
void TEST_CLASS_IN_CLASS(){
17+
__builtin_print("OK!!!");
18+
}
19+
}
20+
21+
static auto test_static_func(){
22+
__builtin_print("test_static_func");
23+
}
24+
25+
static auto test_static_var = "SUCCESS TEST STATIC VAR;";
26+
}
27+
28+
}
229

330
auto main(){
4-
test.run();
31+
__builtin_print(test.test_global_var);
32+
test.test_global_var = 100;
33+
__builtin_print(test.test_global_var);
34+
test.test_function();
35+
36+
test.test_function = func(){
37+
__builtin_print("ABC\n\n\n");
38+
};
39+
test.test_function();
40+
41+
test.test_class test_var1;
42+
auto test_var2 = test.test_class();
43+
__builtin_print(test_var1.test_var);
44+
__builtin_print(test_var2.test_var);
45+
46+
test.test_class.test_static_func();
47+
__builtin_print(test.test_class.test_static_var);
48+
test.test_class.test_static_var = 100;
49+
50+
__builtin_print(test.test_class.test_static_var);
551
}

tests/issue2/main.aq

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,19 @@ auto main(){
66
__builtin_print(test.test_global_var);
77
test.test_function();
88

9+
test.test_function = func(){
10+
__builtin_print("ABC\n\n\n");
11+
};
12+
test.test_function();
13+
914
test.test_class test_var1;
1015
auto test_var2 = test.test_class();
1116
__builtin_print(test_var1.test_var);
1217
__builtin_print(test_var2.test_var);
18+
19+
test.test_class.test_static_func();
20+
__builtin_print(test.test_class.test_static_var);
21+
test.test_class.test_static_var = 100;
22+
23+
__builtin_print(test.test_class.test_static_var);
1324
}

tests/issue2/test.aq

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ auto main(){}
22
auto test_global_var = "SUCCESS";
33

44
auto test_function = func(){
5-
__builtin_print("lambda test OK.");
5+
__builtin_print("lambda test OK.\n\n\n");
66
}
77

88
class test_class {
@@ -17,4 +17,10 @@ class test_class {
1717
__builtin_print("OK!!!");
1818
}
1919
}
20+
21+
static auto test_static_func(){
22+
__builtin_print("test_static_func");
23+
}
24+
25+
static auto test_static_var = "SUCCESS TEST STATIC VAR;";
2026
}

0 commit comments

Comments
 (0)