aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/b.amal5
-rw-r--r--tests/io.amal2
-rw-r--r--tests/main.amal8
-rw-r--r--tests/main.c5
-rw-r--r--tests/sub/a.amal1
5 files changed, 17 insertions, 4 deletions
diff --git a/tests/b.amal b/tests/b.amal
new file mode 100644
index 0000000..c7d833d
--- /dev/null
+++ b/tests/b.amal
@@ -0,0 +1,5 @@
+const a = @import("io.amal");
+
+const nothing = fn {
+
+} \ No newline at end of file
diff --git a/tests/io.amal b/tests/io.amal
index bb7935b..5505d44 100644
--- a/tests/io.amal
+++ b/tests/io.amal
@@ -1,3 +1,5 @@
+const a = @import("sub/a.amal");
+
const puts = fn {
} \ No newline at end of file
diff --git a/tests/main.amal b/tests/main.amal
index ba6247b..d085501 100644
--- a/tests/main.amal
+++ b/tests/main.amal
@@ -1,5 +1,10 @@
const io = @import("io.amal");
+const User = struct {
+ name: str;
+ age: i32;
+}
+
const main = fn {
var hello = fn {
@@ -14,8 +19,9 @@ const main = fn {
/*
episfjpseifipesf
*/
+ //io.puts("lole");
}
const print = fn {
-}
+} \ No newline at end of file
diff --git a/tests/main.c b/tests/main.c
index 8e45ba4..2b57bcf 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -43,9 +43,8 @@ static CHECK_RESULT int test_hash_map() {
int main() {
amal_compiler compiler;
+ FileScopeReference *file_scope;
int result;
- const char *filepath;
- filepath = "tests/main.amal";
return_if_error(test_hash_map());
@@ -55,7 +54,7 @@ int main() {
return 1;
}
- result = amal_compiler_load_file(&compiler, create_buffer_view(filepath, strlen(filepath)));
+ result = amal_compiler_load_file(&compiler, "tests/main.amal", &file_scope);
if(result != AMAL_COMPILER_OK) {
fprintf(stderr, "Failed to load file, error code: %d\n", result);
return 1;
diff --git a/tests/sub/a.amal b/tests/sub/a.amal
new file mode 100644
index 0000000..1e9c8a4
--- /dev/null
+++ b/tests/sub/a.amal
@@ -0,0 +1 @@
+const b = @import("../b.amal"); \ No newline at end of file