aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bytecode.amal17
-rw-r--r--tests/main.c6
2 files changed, 15 insertions, 8 deletions
diff --git a/tests/bytecode.amal b/tests/bytecode.amal
index ef255cd..6941bc8 100644
--- a/tests/bytecode.amal
+++ b/tests/bytecode.amal
@@ -1,8 +1,9 @@
-extern const print_extern: fn;
-extern const print_extern_num: fn(num: i32);
-
-const print = fn {
+/*
+extern const print_extern: fn() i32;
+extern const print_extern_num: fn(num: i32) i32;
+const print = fn() i32 {
+ return 0;
}
const main = fn {
@@ -21,4 +22,10 @@ const print_num = fn(num: i32) i32 {
print_extern_num(num);
print_extern_num(8080);
return num;
-} \ No newline at end of file
+}
+*/
+
+const io = @import("../std/io.amal");
+const main = fn {
+ io.print();
+}
diff --git a/tests/main.c b/tests/main.c
index b2b53cc..eec3a78 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -19,7 +19,7 @@ static int num_tests_run = 0;
}\
}while(0)
-static CHECK_RESULT int test_hash_map() {
+static CHECK_RESULT int test_hash_map(void) {
ArenaAllocator arena_allocator;
HashMapType(BufferView, int) hash_map;
int value;
@@ -132,7 +132,7 @@ static CHECK_RESULT int get_thread_count_env_var(int *thread_count) {
return 0;
}
-static int print_extern() {
+static int print_extern(void) {
printf("hello from amalgam extern func, print_extern!\n");
return 0;
}
@@ -228,7 +228,7 @@ static void test_load_error(const char *filepath, const char *expected_error) {
free(expected_data.expected_error);
}
-static void run_all_tests() {
+static void run_all_tests(void) {
test_load("tests/main.amal");
test_load("tests/utf8bom.amal");
test_load("tests/bytecode.amal");