Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
littlewhitecloud authored Jul 13, 2024
1 parent 86992de commit 26214bd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/other_errors/import_file_with_main.jou
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import "./imported.jou"
import "stdlib/io.jou"

def main() -> int:
printf("%d", add(114, 514))

return 0
9 changes: 9 additions & 0 deletions tests/other_errors/imported.jou
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import "stdlib/io.jou"

def add(a: int, b: int) -> int:
return a + b

def main() -> int: # Output: compiler error in file "tests/other_errors/imported.jou": imported file should not have `main` function
printf("%d", add(1, 2))

return 0

0 comments on commit 26214bd

Please sign in to comment.