Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
baoyachi committed Jul 19, 2024
1 parent 87bd316 commit d33c3ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions example_shadow/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub fn print_build() {
println!("rust_channel:{}", build::RUST_CHANNEL);
println!("cargo_version:{}", build::CARGO_VERSION);
println!("cargo_tree:{}", build::CARGO_TREE);
println!("cargo_tree:{}", build::CARGO_METADATA);

println!("project_name:{}", build::PROJECT_NAME);
println!("build_time:{}", build::BUILD_TIME);
Expand Down
11 changes: 9 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,15 @@ impl Shadow {
let mut print_val = String::from("\n");

// append gen const
for k in self.map.keys() {
let tmp = format!(r#"{}println!("{k}:{{{k}}}\n");{}"#, "\t", "\n");
for (k, v) in &self.map {
let tmp = match v.t {
ConstType::Str | ConstType::Bool => {
format!(r#"{}println!("{k}:{{{k}}}\n");{}"#, "\t", "\n")
}
ConstType::Slice => {
format!(r#"{}println!("{k}:{{:?}}\n",{});{}"#, "\t", k, "\n",)
}
};
print_val.push_str(tmp.as_str());
}

Expand Down

0 comments on commit d33c3ec

Please sign in to comment.