Skip to content

Commit

Permalink
Combine tests into fewer, longer files (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli authored Jan 24, 2023
1 parent a05d691 commit 76506a4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
7 changes: 7 additions & 0 deletions tests/should_succeed/argument.jou
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from "stdlib/io.jou" import putchar

# TODO: should there be a warning for this? Not sure.
def unused_arg(asd: bool) -> void:
return

def putchar3(ch: int) -> void:
putchar(ch)
putchar(ch)
Expand All @@ -10,4 +14,7 @@ def main() -> int:
putchar3('y')
putchar3('o')
putchar('\n')

unused_arg(True)

return 0
5 changes: 2 additions & 3 deletions tests/should_succeed/as.jou
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ def main() -> int:
putchar(72 as byte)
putchar(357 as byte)
putchar(25600108 as byte)
# TODO: unary minus
putchar(0-148 as byte)
putchar(0-2449 as byte)
putchar(-148 as byte)
putchar(-2449 as byte)
putchar('\n')

printf("%#x\n", *("aaaa" as int*)) # Output: 0x61616161
Expand Down
7 changes: 7 additions & 0 deletions tests/should_succeed/plusplus_minusminus.jou
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ def main() -> int:
c = 'a'
printf("%c%c%c%c%c\n", c++, c++, c--, c--, c) # Output: abcba

# A bug in the compiler previously caused this to output "1 1".
# The problem was that even though arguments were evaluated
# left-to-right as they should be, the value of the variable
# was not looked up until all arguments were evaluated.
n = 0
printf("%d %d\n", n, ++n) # Output: 0 1

return 0
6 changes: 0 additions & 6 deletions tests/should_succeed/unused_argument.jou

This file was deleted.

10 changes: 0 additions & 10 deletions tests/should_succeed/var_reuse_bug.jou

This file was deleted.

0 comments on commit 76506a4

Please sign in to comment.