diff options
| author | ruki <[email protected]> | 2021-08-31 23:01:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-08-31 12:49:15 +0800 |
| commit | 219f20a76c2fa40b83ffff7a5fb8967079ef8c7a (patch) | |
| tree | f4288545ad72b1a5353596b19aa63b6d7de49e7a /tests/projects/vala/sharedlib/src | |
| parent | 1b8e4e472b6a7a1d1aeaf65a4a1e7193bcfdc499 (diff) | |
improve vala rules and add more vala tests
Diffstat (limited to 'tests/projects/vala/sharedlib/src')
| -rw-r--r-- | tests/projects/vala/sharedlib/src/main.vala | 6 | ||||
| -rw-r--r-- | tests/projects/vala/sharedlib/src/mymath.vala | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/projects/vala/sharedlib/src/main.vala b/tests/projects/vala/sharedlib/src/main.vala new file mode 100644 index 000000000..da9fd895e --- /dev/null +++ b/tests/projects/vala/sharedlib/src/main.vala @@ -0,0 +1,6 @@ +using MyMath; + +public void main() { + stdout.printf("\n\t2 + 3 is %d", sum(2, 3)); + stdout.printf("\n\t8 squared is %d\n", square(8)); +} diff --git a/tests/projects/vala/sharedlib/src/mymath.vala b/tests/projects/vala/sharedlib/src/mymath.vala new file mode 100644 index 000000000..4f4e761c5 --- /dev/null +++ b/tests/projects/vala/sharedlib/src/mymath.vala @@ -0,0 +1,9 @@ +namespace MyMath { + public int sum(int a, int b) { + return(a + b); + } + + public int square(int a) { + return(a * a); + } +} |
