Skip to content

Commit

Permalink
fix: fix ut test_rename() (#1292)
Browse files Browse the repository at this point in the history
fix: fix ut test_rename(). When executing tests concurrently, test_rename_symbol_on_file() will modify the test file, which will affect the results of test_rename() and cause occasionally failures.

Signed-off-by: he1pa <[email protected]>
  • Loading branch information
He1pa authored May 7, 2024
1 parent e9b70da commit 513ced5
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion kclvm/tools/src/LSP/src/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ Bob = vars.Person {
#[test]
fn test_rename_symbol_on_file() {
let mut root = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
root.push("src/test_data/rename_test/");
root.push("src/test_data/rename_test/rename_on_file");

let mut main_path = root.clone();
let mut base_path = root.clone();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
schema Person:
name: Name
age: int

schema Name:
first: str

a = {
abc: "d"
}

d = a.abc
e = a["abc"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import .base

a = base.Person {
age: 1,
name: {
first: "aa"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import .pkg.vars

Bob = vars.Person {
name: "Bob"
age: 30
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
schema Person:
name: str
age: int

John = Person {
name: "John"
age: 20
}

Alice = Person {
name: "Alice"
age: 30
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema Server:
name: str

0 comments on commit 513ced5

Please sign in to comment.