mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-23 05:07:27 +00:00
ensure the fn value is up-to-date
This commit is contained in:
parent
92eee06596
commit
5209735d0b
2 changed files with 7 additions and 6 deletions
|
@ -227,6 +227,7 @@ macro_rules! setup_tracked_fn {
|
|||
$zalsa::AsId::as_id(&($($input_id),*))
|
||||
}
|
||||
};
|
||||
$Configuration::fn_ingredient($db).fetch($db, key);
|
||||
let database_key_index = $Configuration::fn_ingredient($db).database_key_index(key);
|
||||
$zalsa::accumulated_by($db.as_salsa_database(), database_key_index)
|
||||
}
|
||||
|
|
|
@ -89,6 +89,12 @@ fn accumulate_once() {
|
|||
// Just call accumulate on a base input to see what happens.
|
||||
let input = MyInput::new(&db, 2, 3);
|
||||
let logs = push_logs::accumulated::<Logs>(&db, input);
|
||||
db.assert_logs(expect![[r#"
|
||||
[
|
||||
"push_logs(a = 2, b = 3)",
|
||||
"push_a_logs(2)",
|
||||
"push_b_logs(3)",
|
||||
]"#]]);
|
||||
expect![[r#"
|
||||
[
|
||||
"log_b(0 of 3)",
|
||||
|
@ -98,12 +104,6 @@ fn accumulate_once() {
|
|||
"log_a(1 of 2)",
|
||||
]"#]]
|
||||
.assert_eq(&format!("{:#?}", logs));
|
||||
db.assert_logs(expect![[r#"
|
||||
[
|
||||
"push_logs(a = 2, b = 3)",
|
||||
"push_a_logs(2)",
|
||||
"push_b_logs(3)",
|
||||
]"#]])
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue