-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Expand file tree
/
Copy pathcheck-error-comments.test
More file actions
49 lines (40 loc) · 2.99 KB
/
check-error-comments.test
File metadata and controls
49 lines (40 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
[case noErrorComment]
x: int = 1
[case prototypicalErrorComment]
x: int = "hi" # E: Incompatible types in assignment (expression has type "str", variable has type "int")
[case emptyLineErrorComment-xfail]
# E:
[case oddErrorComments]
x: int = "hi"#E: Incompatible types in assignment (expression has type "str", variable has type "int")
x2: int = "hi" #E: Incompatible types in assignment (expression has type "str", variable has type "int")
x3: int = "hi" # E: Incompatible types in assignment (expression has type "str", variable has type "int")
x4: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int")
x5: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int")
x6: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int")
x7: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int")
x8: int = "hi" \
# E : Incompatible types in assignment (expression has type "str", variable has type "int")
x82: int = "hi"\
# E : Incompatible types in assignment (expression has type "str", variable has type "int")
[case oddErrorCommentsNoteComment]
n: int
reveal_type(n) # N: Revealed type is "builtins.int"
[case oddErrorCommentsThatDontWork-xfail]
-- The space between the ":" and the message actually differs in the output, which we match against
-- so we can't just parse it and replace it; therefore, these do not work.
x: int = "hi"#E:Incompatible types in assignment (expression has type "str", variable has type "int")
x2: int = "hi" #E:Incompatible types in assignment (expression has type "str", variable has type "int")
x3: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int")
x4: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int")
x5: int = "hi" # E : Incompatible types in assignment (expression has type "str", variable has type "int")
[case oddErrorCommentsThatDontWorkCase-xfail]
-- I just didn't bother to implement these.
x: int = "hi" # e: Incompatible types in assignment (expression has type "str", variable has type "int")
x: int = "hi" # w: Incompatible types in assignment (expression has type "str", variable has type "int")
x: int = "hi" # n: Incompatible types in assignment (expression has type "str", variable has type "int")
[case oddErrorCommentsThatDontWorkCaseAndNoColon-xfail]
-- I didn't implement these. This is veering towards the ambiguous.
x: int = "hi" # e: Incompatible types in assignment (expression has type "str", variable has type "int")
x2: int = "hi" # E Incompatible types in assignment (expression has type "str", variable has type "int")
x3: int = "hi" # e Incompatible types in assignment (expression has type "str", variable has type "int")
x4: int = "hi" # e Incompatible types in assignment (expression has type "str", variable has type "int")