Skip to content

Commit

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

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

return 0
import "./imported/imported.jou"
import "stdlib/io.jou"

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

return 0
10 changes: 10 additions & 0 deletions tests/other_errors/imported/imported.jou
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This file is meant to be imported, not ran directly.

import "stdlib/io.jou"

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

def main() -> int:
printf("%d", add(1, 2))
return 0

0 comments on commit 3a8615a

Please sign in to comment.