Skip to content

Commit

Permalink
remove deprecated unit test
Browse files Browse the repository at this point in the history
Signed-off-by: he1pa <[email protected]>
  • Loading branch information
He1pa committed Sep 19, 2024
1 parent b8e2e37 commit d22ab4a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
2 changes: 2 additions & 0 deletions kclvm/parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,8 @@ pub fn parse_kcl_file(
// Add the external package name as prefix of the [`kclvm_ast::ImportStmt`]'s member [`path`].
import_spec.path.node = pkg_info.pkg_path.to_string();
import_spec.pkg_name = pkg_info.pkg_name.clone();
// If k_files is empty, the pkg information will not be found in the file graph.
// Record the empty pkg to prevent loss. After the parse file is completed, fill in the modules
pkgs.insert(pkg_info.pkg_path.clone(), vec![]);
// Add file dependencies.
let mut paths: Vec<PkgFile> = pkg_info
Expand Down
27 changes: 0 additions & 27 deletions kclvm/tools/src/LSP/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crossbeam_channel::after;
use crossbeam_channel::select;
use indexmap::IndexSet;
use kclvm_ast::MAIN_PKG;
use kclvm_driver::lookup_compile_workspace;
use kclvm_driver::toolchain;
use kclvm_driver::toolchain::Metadata;
Expand Down Expand Up @@ -2104,32 +2103,6 @@ fn rename_test() {
assert_eq!(res.result.unwrap(), to_json(expect).unwrap());
}

#[test]
fn compile_unit_test() {
let path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let mut test_file = path.clone();
test_file.push("src/test_data/compile_unit/b.k");
let file = test_file.to_str().unwrap();

let prog = compile_with_params(Params {
file: Some(file.to_string()),
module_cache: None,
scope_cache: None,
vfs: Some(KCLVfs::default()),
gs_cache: Some(KCLGlobalStateCache::default()),
})
.1
.unwrap()
.0;
// b.k is not contained in kcl.yaml but need to be contained in main pkg
assert!(prog
.pkgs
.get(MAIN_PKG)
.unwrap()
.iter()
.any(|m| m.filename == file))
}

#[test]
fn kcl_workspace_init_kclwork_test() {
let tool: crate::state::KCLToolChain = Arc::new(RwLock::new(toolchain::default()));
Expand Down

0 comments on commit d22ab4a

Please sign in to comment.