mirror of
https://github.com/salsa-rs/salsa.git
synced 2024-11-24 20:20:26 +00:00
31 lines
476 B
Rust
31 lines
476 B
Rust
//! Test that a setting a field on a `#[salsa::input]`
|
|
//! overwrites and returns the old value.
|
|
|
|
use test_log::test;
|
|
|
|
#[salsa::db]
|
|
#[derive(Default)]
|
|
struct Database {
|
|
storage: salsa::Storage<Self>,
|
|
}
|
|
|
|
#[salsa::db]
|
|
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() {}
|