-
Notifications
You must be signed in to change notification settings - Fork 155
Closed
Labels
bugSomething isn't workingSomething isn't workingsemanticIssues or PRs related to kcl semantic and checkerIssues or PRs related to kcl semantic and checker
Milestone
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
Write the following unit test in the loader crate
#[macro_export]
macro_rules! load_package_scopes_snapshot {
($name:ident, $src:expr) => {
#[test]
fn $name() {
let p = load_packages(&LoadPackageOptions {
paths: vec!["test.k".to_string()],
load_opts: Some(LoadProgramOptions {
k_code_list: vec![$src.to_string()],
..Default::default()
}),
load_builtin: false,
..Default::default()
})
.unwrap();
insta::assert_snapshot!(format!("{:#?}", p.scopes.get(&p.pkg_scope_map["__main__"]).unwrap().children));
}
};
}
load_package_scopes_snapshot! {schema_scope_0, r#"opt = option
schema Person:
name: str
age: int
p = Person {
name: "Alice"
age: 18
}
"#}2. What did you expect to see? (Required)
The length of children is 2
3. What did you see instead (Required)
The length of children is 2
4. What is your KCL components version? (Required)
Version: 0.9.0-c020ab3eb4b9179219d6837a57f5d323
Platform: aarch64-apple-darwin
GitCommit: fdd797ac59b2b0a5259cafdf8850a0f6abbc2fce
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingsemanticIssues or PRs related to kcl semantic and checkerIssues or PRs related to kcl semantic and checker