Skip to content

Commit fc40734

Browse files
committed
Close #760
1 parent c57fb4e commit fc40734

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

crates/emmylua_code_analysis/src/diagnostic/test/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ mod missing_fields_test;
1616
mod missing_parameter_test;
1717
mod need_check_nil_test;
1818
mod param_type_check_test;
19+
mod readonly_check;
1920
mod redefined_local_test;
2021
mod redundant_parameter_test;
2122
mod require_module_visibility_test;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
}

0 commit comments

Comments
 (0)