update expect tests

This commit is contained in:
Niko Matsakis 2024-07-19 06:24:51 -04:00
parent b677019407
commit 82a1e59e46
4 changed files with 22 additions and 14 deletions

View file

@ -74,8 +74,12 @@ fn test1() {
compute(&db, l1);
expect![[r#"
[
11,
1,
Integers(
11,
),
Integers(
1,
),
]
"#]]
.assert_debug_eq(&compute::accumulated::<Integers>(&db, l1));
@ -84,8 +88,12 @@ fn test1() {
compute(&db, l1);
expect![[r#"
[
12,
2,
Integers(
12,
),
Integers(
2,
),
]
"#]]
.assert_debug_eq(&compute::accumulated::<Integers>(&db, l1));

View file

@ -81,9 +81,9 @@ fn test1() {
assert_eq!(compute(&db, l2), 2);
db.assert_logs(expect![[r#"
[
"compute(List { [salsa id]: 1 })",
"accumulated(List { [salsa id]: 0 })",
"compute(List { [salsa id]: 0 })",
"compute(List { [salsa id]: 1, value: 2, next: Some(List { [salsa id]: 0, value: 1, next: None }) })",
"accumulated(List { [salsa id]: 0, value: 1, next: None })",
"compute(List { [salsa id]: 0, value: 1, next: None })",
]"#]]);
// When we mutate `l1`, we should re-execute `compute` for `l1`,
@ -93,7 +93,7 @@ fn test1() {
assert_eq!(compute(&db, l2), 2);
db.assert_logs(expect![[r#"
[
"accumulated(List { [salsa id]: 0 })",
"compute(List { [salsa id]: 0 })",
"accumulated(List { [salsa id]: 0, value: 2, next: None })",
"compute(List { [salsa id]: 0, value: 2, next: None })",
]"#]]);
}

View file

@ -73,8 +73,8 @@ fn test1() {
assert_eq!(compute(&db, l2), 2);
db.assert_logs(expect![[r#"
[
"compute(List { [salsa id]: 1 })",
"compute(List { [salsa id]: 0 })",
"compute(List { [salsa id]: 1, value: 2, next: Some(List { [salsa id]: 0, value: 1, next: None }) })",
"compute(List { [salsa id]: 0, value: 1, next: None })",
]"#]]);
// When we mutate `l1`, we should re-execute `compute` for `l1`,
@ -85,7 +85,7 @@ fn test1() {
assert_eq!(compute(&db, l2), 2);
db.assert_logs(expect![[r#"
[
"compute(List { [salsa id]: 1 })",
"compute(List { [salsa id]: 0 })",
"compute(List { [salsa id]: 1, value: 2, next: Some(List { [salsa id]: 0, value: 2, next: None }) })",
"compute(List { [salsa id]: 0, value: 2, next: None })",
]"#]]);
}

View file

@ -169,7 +169,7 @@ fn change_a_from_2_to_0() {
.assert_eq(&format!("{:#?}", logs));
db.assert_logs(expect![[r#"
[
"push_logs(a = 1, b = 3)",
"push_logs(a = 0, b = 3)",
]"#]]);
}