File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
crates/emmylua_code_analysis/src/diagnostic/test Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ mod missing_fields_test;
1616mod missing_parameter_test;
1717mod need_check_nil_test;
1818mod param_type_check_test;
19+ mod readonly_check;
1920mod redefined_local_test;
2021mod redundant_parameter_test;
2122mod require_module_visibility_test;
Original file line number Diff line number Diff line change 1+ #[ cfg( test) ]
2+ mod test {
3+ use crate :: { DiagnosticCode , VirtualWorkspace } ;
4+
5+ #[ test]
6+ fn test_issue_760 ( ) {
7+ let mut ws = VirtualWorkspace :: new ( ) ;
8+
9+ assert ! ( !ws. check_code_for(
10+ DiagnosticCode :: ReadOnly ,
11+ r#"
12+ ---@readonly
13+ local errorCode = {}
14+
15+ errorCode.NOT_FOUND = 10 --- show warnings attemp modify readonly variables.
16+ "#
17+ ) ) ;
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments