summaryrefslogtreecommitdiff
path: root/tests/projects/vala/sharedlib/src
diff options
context:
space:
mode:
Diffstat (limited to 'tests/projects/vala/sharedlib/src')
-rw-r--r--tests/projects/vala/sharedlib/src/main.vala6
-rw-r--r--tests/projects/vala/sharedlib/src/mymath.vala9
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);
+ }
+}