2024-05-19 11:42:17 +00:00
|
|
|
//! Test that a setting a field on a `#[salsa::input]`
|
|
|
|
//! overwrites and returns the old value.
|
|
|
|
|
|
|
|
use test_log::test;
|
|
|
|
|
2024-07-17 12:42:06 +00:00
|
|
|
#[salsa::db]
|
2024-05-19 11:42:17 +00:00
|
|
|
#[derive(Default)]
|
|
|
|
struct Database {
|
|
|
|
storage: salsa::Storage<Self>,
|
|
|
|
}
|
|
|
|
|
2024-07-17 12:42:06 +00:00
|
|
|
#[salsa::db]
|
2024-05-19 11:42:17 +00:00
|
|
|
impl salsa::Database for Database {}
|
|
|
|
|
|
|
|
#[salsa::input]
|
|
|
|
struct MyInput {
|
|
|
|
field: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[salsa::tracked]
|
|
|
|
struct MyTracked<'db> {
|
|
|
|
field: MyInterned<'db>,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[salsa::interned]
|
|
|
|
struct MyInterned<'db> {
|
|
|
|
field: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn execute() {}
|