This commit is contained in:
Niko Matsakis 2024-07-19 08:09:55 -04:00
parent 68a3a7fceb
commit ad61687e83
4 changed files with 7 additions and 8 deletions

View file

@ -1,5 +1,4 @@
use proc_macro2::TokenStream;
use syn::parse::Nothing;
use crate::{
hygiene::Hygiene,

View file

@ -1,4 +1,4 @@
use crate::{accumulator, storage::DatabaseGen, Database, Id};
use crate::{accumulator, storage::DatabaseGen, Id};
use super::{Configuration, IngredientImpl};

View file

@ -74,13 +74,13 @@ fn execute() {
assert_eq!(final_result_depends_on_x(&db, input), 22);
db.assert_logs(expect![[r#"
[
"final_result_depends_on_x(MyInput { [salsa id]: 0 })",
"final_result_depends_on_x(MyInput { [salsa id]: 0, field: 22 })",
]"#]]);
assert_eq!(final_result_depends_on_y(&db, input), 22);
db.assert_logs(expect![[r#"
[
"final_result_depends_on_y(MyInput { [salsa id]: 0 })",
"final_result_depends_on_y(MyInput { [salsa id]: 0, field: 22 })",
]"#]]);
input.set_field(&mut db).to(23);
@ -90,7 +90,7 @@ fn execute() {
assert_eq!(final_result_depends_on_x(&db, input), 24);
db.assert_logs(expect![[r#"
[
"final_result_depends_on_x(MyInput { [salsa id]: 0 })",
"final_result_depends_on_x(MyInput { [salsa id]: 0, field: 23 })",
]"#]]);
// y = 23 / 2 = 11

View file

@ -59,13 +59,13 @@ fn execute() {
assert_eq!(result_depends_on_x(&db, input), 23);
db.assert_logs(expect![[r#"
[
"result_depends_on_x(MyInput { [salsa id]: 0 })",
"result_depends_on_x(MyInput { [salsa id]: 0, x: 22, y: 33 })",
]"#]]);
assert_eq!(result_depends_on_y(&db, input), 32);
db.assert_logs(expect![[r#"
[
"result_depends_on_y(MyInput { [salsa id]: 0 })",
"result_depends_on_y(MyInput { [salsa id]: 0, x: 22, y: 33 })",
]"#]]);
input.set_x(&mut db).to(23);
@ -73,7 +73,7 @@ fn execute() {
assert_eq!(result_depends_on_x(&db, input), 24);
db.assert_logs(expect![[r#"
[
"result_depends_on_x(MyInput { [salsa id]: 0 })",
"result_depends_on_x(MyInput { [salsa id]: 0, x: 23, y: 33 })",
]"#]]);
// input y is the same, so result depends on y