mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-13 00:40:22 +00:00
run tests with UPDATE_EXPECT=1
This commit is contained in:
parent
5cb519852b
commit
a27befeeba
10 changed files with 70 additions and 70 deletions
|
@ -507,7 +507,7 @@ fn parse_example() {
|
|||
},
|
||||
Statement {
|
||||
span: Span {
|
||||
[salsa id]: Id(21),
|
||||
[salsa id]: Id(15),
|
||||
start: 57,
|
||||
end: 102,
|
||||
},
|
||||
|
@ -518,7 +518,7 @@ fn parse_example() {
|
|||
text: "area_circle",
|
||||
},
|
||||
name_span: Span {
|
||||
[salsa id]: Id(10),
|
||||
[salsa id]: Id(a),
|
||||
start: 60,
|
||||
end: 71,
|
||||
},
|
||||
|
@ -529,21 +529,21 @@ fn parse_example() {
|
|||
],
|
||||
body: Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(20),
|
||||
[salsa id]: Id(14),
|
||||
start: 77,
|
||||
end: 102,
|
||||
},
|
||||
data: Op(
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(17),
|
||||
[salsa id]: Id(11),
|
||||
start: 77,
|
||||
end: 86,
|
||||
},
|
||||
data: Op(
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(14),
|
||||
[salsa id]: Id(e),
|
||||
start: 77,
|
||||
end: 81,
|
||||
},
|
||||
|
@ -554,7 +554,7 @@ fn parse_example() {
|
|||
Multiply,
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(16),
|
||||
[salsa id]: Id(10),
|
||||
start: 84,
|
||||
end: 86,
|
||||
},
|
||||
|
@ -569,7 +569,7 @@ fn parse_example() {
|
|||
Multiply,
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(19),
|
||||
[salsa id]: Id(13),
|
||||
start: 88,
|
||||
end: 102,
|
||||
},
|
||||
|
@ -586,14 +586,14 @@ fn parse_example() {
|
|||
},
|
||||
Statement {
|
||||
span: Span {
|
||||
[salsa id]: Id(28),
|
||||
[salsa id]: Id(1c),
|
||||
start: 102,
|
||||
end: 141,
|
||||
},
|
||||
data: Print(
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(27),
|
||||
[salsa id]: Id(1b),
|
||||
start: 108,
|
||||
end: 128,
|
||||
},
|
||||
|
@ -604,7 +604,7 @@ fn parse_example() {
|
|||
[
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(23),
|
||||
[salsa id]: Id(17),
|
||||
start: 123,
|
||||
end: 124,
|
||||
},
|
||||
|
@ -614,7 +614,7 @@ fn parse_example() {
|
|||
},
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(25),
|
||||
[salsa id]: Id(19),
|
||||
start: 126,
|
||||
end: 127,
|
||||
},
|
||||
|
@ -629,14 +629,14 @@ fn parse_example() {
|
|||
},
|
||||
Statement {
|
||||
span: Span {
|
||||
[salsa id]: Id(33),
|
||||
[salsa id]: Id(21),
|
||||
start: 141,
|
||||
end: 174,
|
||||
},
|
||||
data: Print(
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(32),
|
||||
[salsa id]: Id(20),
|
||||
start: 147,
|
||||
end: 161,
|
||||
},
|
||||
|
@ -647,7 +647,7 @@ fn parse_example() {
|
|||
[
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(30),
|
||||
[salsa id]: Id(1e),
|
||||
start: 159,
|
||||
end: 160,
|
||||
},
|
||||
|
@ -662,21 +662,21 @@ fn parse_example() {
|
|||
},
|
||||
Statement {
|
||||
span: Span {
|
||||
[salsa id]: Id(38),
|
||||
[salsa id]: Id(26),
|
||||
start: 174,
|
||||
end: 195,
|
||||
},
|
||||
data: Print(
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(37),
|
||||
[salsa id]: Id(25),
|
||||
start: 180,
|
||||
end: 186,
|
||||
},
|
||||
data: Op(
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(34),
|
||||
[salsa id]: Id(22),
|
||||
start: 180,
|
||||
end: 182,
|
||||
},
|
||||
|
@ -687,7 +687,7 @@ fn parse_example() {
|
|||
Multiply,
|
||||
Expression {
|
||||
span: Span {
|
||||
[salsa id]: Id(36),
|
||||
[salsa id]: Id(24),
|
||||
start: 185,
|
||||
end: 186,
|
||||
},
|
||||
|
@ -740,7 +740,7 @@ fn parse_precedence() {
|
|||
statements: [
|
||||
Statement {
|
||||
span: Span {
|
||||
[salsa id]: Id(10),
|
||||
[salsa id]: Id(a),
|
||||
start: 0,
|
||||
end: 19,
|
||||
},
|
||||
|
|
|
@ -267,8 +267,8 @@ fn fix_bad_variable_in_function() {
|
|||
"#]],
|
||||
expect![[r#"
|
||||
[
|
||||
"Event: Event { thread_id: ThreadId(11), kind: WillExecute { database_key: parse_statements(0) } }",
|
||||
"Event: Event { thread_id: ThreadId(11), kind: WillExecute { database_key: type_check_function(0) } }",
|
||||
"Event: Event { thread_id: ThreadId(11), kind: WillExecute { database_key: parse_statements(Id(0)) } }",
|
||||
"Event: Event { thread_id: ThreadId(11), kind: WillExecute { database_key: type_check_function(Id(0)) } }",
|
||||
]
|
||||
"#]],
|
||||
)],
|
||||
|
|
|
@ -161,8 +161,8 @@ fn cycle_memoized() {
|
|||
let cycle = extract_cycle(|| memoized_a(db, input));
|
||||
let expected = expect![[r#"
|
||||
[
|
||||
memoized_a(0),
|
||||
memoized_b(0),
|
||||
memoized_a(Id(0)),
|
||||
memoized_b(Id(0)),
|
||||
]
|
||||
"#]];
|
||||
expected.assert_debug_eq(&cycle.all_participants(db));
|
||||
|
@ -176,8 +176,8 @@ fn cycle_volatile() {
|
|||
let cycle = extract_cycle(|| volatile_a(db, input));
|
||||
let expected = expect![[r#"
|
||||
[
|
||||
volatile_a(0),
|
||||
volatile_b(0),
|
||||
volatile_a(Id(0)),
|
||||
volatile_b(Id(0)),
|
||||
]
|
||||
"#]];
|
||||
expected.assert_debug_eq(&cycle.all_participants(db));
|
||||
|
@ -207,8 +207,8 @@ fn inner_cycle() {
|
|||
assert!(err.is_err());
|
||||
let expected = expect![[r#"
|
||||
[
|
||||
"cycle_a(0)",
|
||||
"cycle_b(0)",
|
||||
"cycle_a(Id(0))",
|
||||
"cycle_b(Id(0))",
|
||||
]
|
||||
"#]];
|
||||
expected.assert_debug_eq(&err.unwrap_err().cycle);
|
||||
|
@ -314,8 +314,8 @@ fn cycle_mixed_1() {
|
|||
|
||||
let expected = expect![[r#"
|
||||
[
|
||||
"cycle_b(0)",
|
||||
"cycle_c(0)",
|
||||
"cycle_b(Id(0))",
|
||||
"cycle_c(Id(0))",
|
||||
]
|
||||
"#]];
|
||||
expected.assert_debug_eq(&cycle_c(db, abc).unwrap_err().cycle);
|
||||
|
@ -332,12 +332,12 @@ fn cycle_mixed_2() {
|
|||
// +-----------+
|
||||
let abc = ABC::new(db, CycleQuery::B, CycleQuery::C, CycleQuery::A);
|
||||
let expected = expect![[r#"
|
||||
[
|
||||
"cycle_a(0)",
|
||||
"cycle_b(0)",
|
||||
"cycle_c(0)",
|
||||
]
|
||||
"#]];
|
||||
[
|
||||
"cycle_a(Id(0))",
|
||||
"cycle_b(Id(0))",
|
||||
"cycle_c(Id(0))",
|
||||
]
|
||||
"#]];
|
||||
expected.assert_debug_eq(&cycle_a(db, abc).unwrap_err().cycle);
|
||||
})
|
||||
}
|
||||
|
@ -361,12 +361,12 @@ fn cycle_deterministic_order() {
|
|||
let expected = expect![[r#"
|
||||
(
|
||||
[
|
||||
"cycle_a(0)",
|
||||
"cycle_b(0)",
|
||||
"cycle_a(Id(0))",
|
||||
"cycle_b(Id(0))",
|
||||
],
|
||||
[
|
||||
"cycle_a(0)",
|
||||
"cycle_b(0)",
|
||||
"cycle_a(Id(0))",
|
||||
"cycle_b(Id(0))",
|
||||
],
|
||||
)
|
||||
"#]];
|
||||
|
@ -396,16 +396,16 @@ fn cycle_multiple() {
|
|||
let expected = expect![[r#"
|
||||
(
|
||||
[
|
||||
"cycle_a(0)",
|
||||
"cycle_b(0)",
|
||||
"cycle_a(Id(0))",
|
||||
"cycle_b(Id(0))",
|
||||
],
|
||||
[
|
||||
"cycle_a(0)",
|
||||
"cycle_b(0)",
|
||||
"cycle_a(Id(0))",
|
||||
"cycle_b(Id(0))",
|
||||
],
|
||||
[
|
||||
"cycle_a(0)",
|
||||
"cycle_b(0)",
|
||||
"cycle_a(Id(0))",
|
||||
"cycle_b(Id(0))",
|
||||
],
|
||||
)
|
||||
"#]];
|
||||
|
@ -428,7 +428,7 @@ fn cycle_recovery_set_but_not_participating() {
|
|||
let r = extract_cycle(|| drop(cycle_a(db, abc)));
|
||||
let expected = expect![[r#"
|
||||
[
|
||||
cycle_c(0),
|
||||
cycle_c(Id(0)),
|
||||
]
|
||||
"#]];
|
||||
expected.assert_debug_eq(&r.all_participants(db));
|
||||
|
|
|
@ -80,11 +80,11 @@ fn basic() {
|
|||
db.assert_logs(expect![[r#"
|
||||
[
|
||||
"intermediate_result(MyInput { [salsa id]: Id(0), field: 2 })",
|
||||
"salsa_event(WillDiscardStaleOutput { execute_key: create_tracked_structs(0), output_key: MyTracked(2) })",
|
||||
"salsa_event(DidDiscard { key: MyTracked(2) })",
|
||||
"salsa_event(DidDiscard { key: contribution_from_struct(2) })",
|
||||
"salsa_event(DidDiscard { key: MyTracked(5) })",
|
||||
"salsa_event(DidDiscard { key: copy_field(5) })",
|
||||
"salsa_event(WillDiscardStaleOutput { execute_key: create_tracked_structs(Id(0)), output_key: MyTracked(Id(2)) })",
|
||||
"salsa_event(DidDiscard { key: MyTracked(Id(2)) })",
|
||||
"salsa_event(DidDiscard { key: contribution_from_struct(Id(2)) })",
|
||||
"salsa_event(DidDiscard { key: MyTracked(Id(5)) })",
|
||||
"salsa_event(DidDiscard { key: copy_field(Id(5)) })",
|
||||
"final_result(MyInput { [salsa id]: Id(0), field: 2 })",
|
||||
]"#]]);
|
||||
}
|
||||
|
|
|
@ -67,9 +67,9 @@ fn basic() {
|
|||
db.assert_logs(expect![[r#"
|
||||
[
|
||||
"intermediate_result(MyInput { [salsa id]: Id(0), field: 2 })",
|
||||
"salsa_event(WillDiscardStaleOutput { execute_key: create_tracked_structs(0), output_key: MyTracked(2) })",
|
||||
"salsa_event(DidDiscard { key: MyTracked(2) })",
|
||||
"salsa_event(DidDiscard { key: contribution_from_struct(2) })",
|
||||
"salsa_event(WillDiscardStaleOutput { execute_key: create_tracked_structs(Id(0)), output_key: MyTracked(Id(2)) })",
|
||||
"salsa_event(DidDiscard { key: MyTracked(Id(2)) })",
|
||||
"salsa_event(DidDiscard { key: contribution_from_struct(Id(2)) })",
|
||||
"final_result(MyInput { [salsa id]: Id(0), field: 2 })",
|
||||
]"#]]);
|
||||
}
|
||||
|
|
|
@ -58,8 +58,8 @@ fn execute() {
|
|||
if let Some(c) = err_b.downcast_ref::<salsa::Cycle>() {
|
||||
let expected = expect![[r#"
|
||||
[
|
||||
a(0),
|
||||
b(0),
|
||||
a(Id(0)),
|
||||
b(Id(0)),
|
||||
]
|
||||
"#]];
|
||||
expected.assert_debug_eq(&c.all_participants(&db));
|
||||
|
|
|
@ -51,7 +51,7 @@ fn test_leaked_inputs_ignored() {
|
|||
db.assert_logs(expect![[r#"
|
||||
[
|
||||
"Event { thread_id: ThreadId(2), kind: WillCheckCancellation }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillExecute { database_key: function(0) } }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillExecute { database_key: function(Id(0)) } }",
|
||||
]"#]]);
|
||||
|
||||
assert_eq!(result_in_rev_1, 0);
|
||||
|
@ -68,7 +68,7 @@ fn test_leaked_inputs_ignored() {
|
|||
[
|
||||
"Event { thread_id: ThreadId(2), kind: DidSetCancellationFlag }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillCheckCancellation }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillExecute { database_key: function(0) } }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillExecute { database_key: function(Id(0)) } }",
|
||||
]"#]]);
|
||||
|
||||
// Because salsa did not see any way for the tracked
|
||||
|
|
|
@ -27,7 +27,7 @@ fn execute() {
|
|||
|
||||
db.assert_logs(expect![[r#"
|
||||
[
|
||||
"salsa_event(WillExecute { database_key: tracked_fn(0) })",
|
||||
"salsa_event(WillExecute { database_key: tracked_fn(Id(0)) })",
|
||||
]"#]]);
|
||||
|
||||
// Bumps the revision
|
||||
|
@ -38,6 +38,6 @@ fn execute() {
|
|||
|
||||
db.assert_logs(expect![[r#"
|
||||
[
|
||||
"salsa_event(DidValidateMemoizedValue { database_key: tracked_fn(0) })",
|
||||
"salsa_event(DidValidateMemoizedValue { database_key: tracked_fn(Id(0)) })",
|
||||
]"#]]);
|
||||
}
|
||||
|
|
|
@ -62,9 +62,9 @@ fn execute() {
|
|||
|
||||
db.assert_logs(expect![[r#"
|
||||
[
|
||||
"salsa_event(WillExecute { database_key: the_fn(0) })",
|
||||
"salsa_event(WillExecute { database_key: make_tracked_struct(0) })",
|
||||
"salsa_event(WillExecute { database_key: read_tracked_struct(0) })",
|
||||
"salsa_event(WillExecute { database_key: the_fn(Id(0)) })",
|
||||
"salsa_event(WillExecute { database_key: make_tracked_struct(Id(0)) })",
|
||||
"salsa_event(WillExecute { database_key: read_tracked_struct(Id(0)) })",
|
||||
]"#]]);
|
||||
|
||||
// Update the input to `false` and re-execute.
|
||||
|
@ -78,8 +78,8 @@ fn execute() {
|
|||
|
||||
db.assert_logs(expect![[r#"
|
||||
[
|
||||
"salsa_event(WillExecute { database_key: make_tracked_struct(0) })",
|
||||
"salsa_event(DidValidateMemoizedValue { database_key: read_tracked_struct(0) })",
|
||||
"salsa_event(DidValidateMemoizedValue { database_key: the_fn(0) })",
|
||||
"salsa_event(WillExecute { database_key: make_tracked_struct(Id(0)) })",
|
||||
"salsa_event(DidValidateMemoizedValue { database_key: read_tracked_struct(Id(0)) })",
|
||||
"salsa_event(DidValidateMemoizedValue { database_key: the_fn(Id(0)) })",
|
||||
]"#]]);
|
||||
}
|
||||
|
|
|
@ -29,9 +29,9 @@ fn execute() {
|
|||
db.assert_logs(expect![[r#"
|
||||
[
|
||||
"Event { thread_id: ThreadId(2), kind: WillCheckCancellation }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillExecute { database_key: tracked_fn(0) } }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillExecute { database_key: tracked_fn(Id(0)) } }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillCheckCancellation }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillExecute { database_key: tracked_fn(1) } }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillExecute { database_key: tracked_fn(Id(1)) } }",
|
||||
]"#]]);
|
||||
|
||||
db.synthetic_write(Durability::LOW);
|
||||
|
@ -48,8 +48,8 @@ fn execute() {
|
|||
[
|
||||
"Event { thread_id: ThreadId(2), kind: DidSetCancellationFlag }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillCheckCancellation }",
|
||||
"Event { thread_id: ThreadId(2), kind: DidValidateMemoizedValue { database_key: tracked_fn(0) } }",
|
||||
"Event { thread_id: ThreadId(2), kind: DidValidateMemoizedValue { database_key: tracked_fn(Id(0)) } }",
|
||||
"Event { thread_id: ThreadId(2), kind: WillCheckCancellation }",
|
||||
"Event { thread_id: ThreadId(2), kind: DidValidateMemoizedValue { database_key: tracked_fn(1) } }",
|
||||
"Event { thread_id: ThreadId(2), kind: DidValidateMemoizedValue { database_key: tracked_fn(Id(1)) } }",
|
||||
]"#]]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue