Skip to content

Commit 6e50bd6

Browse files
kinto0meta-codesync[bot]
authored andcommitted
test that all caps variable definition is kind constant
Summary: looks like there currently aren't tests Reviewed By: stroxler Differential Revision: D88648827 fbshipit-source-id: cd1910dc2640a22ed045bb0c3392123d053fa971
1 parent 596f32f commit 6e50bd6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

pyrefly/lib/test/lsp/hover.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,3 +422,32 @@ z: list[int] = []
422422
report
423423
);
424424
}
425+
426+
#[test]
427+
fn constant_kind_for_caps_test() {
428+
let code = r#"
429+
XYZ = 5
430+
# ^
431+
xyz = 5
432+
# ^
433+
"#;
434+
let report = get_batched_lsp_operations_report(&[("main", code)], get_test_report);
435+
assert_eq!(
436+
r#"
437+
# main.py
438+
2 | XYZ = 5
439+
^
440+
```python
441+
(constant) XYZ: Literal[5]
442+
```
443+
444+
4 | xyz = 5
445+
^
446+
```python
447+
(variable) xyz: Literal[5]
448+
```
449+
"#
450+
.trim(),
451+
report.trim(),
452+
);
453+
}

0 commit comments

Comments
 (0)