Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-q committed Jan 18, 2024
1 parent 32015b4 commit c37bc1f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/else_expr_type_change.err
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Guppy compilation failed. Error in file $FILE:8
7: (y := y + 1) if x else (y := True)
8: return y
^
GuppyError: Variable `y` can refer to different types: `int` (at 7:5) vs `bool` (at 7:28)
GuppyTypeError: Expected return value of type `int`, got `bool`
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/else_type_change.err
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Guppy compilation failed. Error in file $FILE:11
10: y = True
11: return y
^
GuppyError: Variable `y` can refer to different types: `int` (at 8:8) vs `bool` (at 10:8)
GuppyTypeError: Expected return value of type `int`, got `bool`
2 changes: 1 addition & 1 deletion tests/error/errors_on_usage/if_different_types.err
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Guppy compilation failed. Error in file $FILE:10
9: y = False
10: return y
^
GuppyError: Variable `y` can refer to different types: `int` (at 7:8) vs `bool` (at 9:8)
GuppyTypeError: Expected return value of type `int`, got `bool`
10 changes: 5 additions & 5 deletions tests/error/linear_errors/if_both_unused.err
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Guppy compilation failed. Error in file $FILE:19
Guppy compilation failed. Error in file $FILE:21

17: def foo(b: bool) -> int:
18: if b:
19: q = new_qubit()
^
19: q = new_qubit()
20: else:
21: q = new_qubit()
^
GuppyError: Variable `q` with linear type `Qubit` is not used on all control-flow paths
10 changes: 5 additions & 5 deletions tests/error/linear_errors/if_both_unused_reassign.err
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Guppy compilation failed. Error in file $FILE:19
Guppy compilation failed. Error in file $FILE:21

17: def foo(b: bool) -> Qubit:
18: if b:
19: q = new_qubit()
^
19: q = new_qubit()
20: else:
21: q = new_qubit()
^
GuppyError: Variable `q` with linear type `Qubit` is not used on all control-flow paths
4 changes: 2 additions & 2 deletions tests/error/nested_errors/different_types_if.err
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Guppy compilation failed. Error in file $FILE:13
11: return False
12:
13: return bar()
^^^
GuppyError: Variable `bar` can refer to different types: `() -> int` (at 7:8) vs `() -> bool` (at 10:8)
^^^^^
GuppyTypeError: Expected expression of type `int`, got `bool`

0 comments on commit c37bc1f

Please sign in to comment.