mirror of
https://github.com/salsa-rs/salsa.git
synced 2025-01-23 05:07:27 +00:00
Add failing test
This commit is contained in:
parent
d5018d5614
commit
4609fd0043
1 changed files with 15 additions and 0 deletions
|
@ -2,13 +2,28 @@
|
||||||
//! compiles and executes successfully.
|
//! compiles and executes successfully.
|
||||||
#![allow(warnings)]
|
#![allow(warnings)]
|
||||||
|
|
||||||
|
use crate::common::LogDatabase;
|
||||||
|
|
||||||
|
mod common;
|
||||||
|
|
||||||
#[salsa::tracked]
|
#[salsa::tracked]
|
||||||
fn tracked_fn(db: &dyn salsa::Database) -> u32 {
|
fn tracked_fn(db: &dyn salsa::Database) -> u32 {
|
||||||
44
|
44
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[salsa::tracked]
|
||||||
|
fn tracked_custom_db(db: &dyn LogDatabase) -> u32 {
|
||||||
|
44
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn execute() {
|
fn execute() {
|
||||||
let mut db = salsa::DatabaseImpl::new();
|
let mut db = salsa::DatabaseImpl::new();
|
||||||
assert_eq!(tracked_fn(&db), 44);
|
assert_eq!(tracked_fn(&db), 44);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn execute_custom() {
|
||||||
|
let mut db = common::LoggerDatabase::new();
|
||||||
|
assert_eq!(tracked_custom_db(&db), 44);
|
||||||
|
}
|
Loading…
Reference in a new issue