Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Dec 26, 2023
1 parent babd9fe commit 089ab04
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions tests/other_errors/assert_fail.jou
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ def main() -> int:
assert lol and wat
assert lol and not wat # Output: Assertion 'lol and not wat' failed in file "tests/other_errors/assert_fail.jou", line 5.

# TODO: Compiler should be clever enough to not warn about missing return statement, but it isn't.
return 0
# No need for a "return 0" because compiler knows we will never get here.
3 changes: 1 addition & 2 deletions tests/other_errors/assert_fail_multiline.jou
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ def main() -> int:
and not wat
)

# TODO: Compiler should be clever enough to not warn about missing return statement, but it isn't.
return 0
# No need for a "return 0" because compiler knows we will never get here.
10 changes: 4 additions & 6 deletions tests/should_succeed/and_or_not.jou
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,10 @@ def main() -> int:
printf("%d", False or False or False)
printf("\n")

# TODO: presumably these should emit warnings too

# Output: Precedence and 0001
printf("Precedence and ")
printf("%d", not True and not True)
printf("%d", not True and not False)
printf("%d", not True and not True) # Warning: this code will never run
printf("%d", not True and not False) # Warning: this code will never run
printf("%d", not False and not True)
printf("%d", not False and not False)
printf("\n")
Expand All @@ -73,8 +71,8 @@ def main() -> int:
printf("Precedence or ")
printf("%d", not True or not True)
printf("%d", not True or not False)
printf("%d", not False or not True)
printf("%d", not False or not False)
printf("%d", not False or not True) # Warning: this code will never run
printf("%d", not False or not False) # Warning: this code will never run
printf("\n")

# Output: Side effects and aAbBcd
Expand Down

0 comments on commit 089ab04

Please sign in to comment.