()
| 592 | |
| 593 | #[test] |
| 594 | fn cas_failure() { |
| 595 | let mut engine = make_engine(); |
| 596 | engine.put(1, "state", b"p1", b"fighting", 0, 1000, Surrogate::ZERO); |
| 597 | let result = engine.cas(1, "state", b"p1", b"idle", b"in_match", 1000); |
| 598 | assert!(!result.success); |
| 599 | assert_eq!( |
| 600 | result.current_value.as_deref(), |
| 601 | Some(b"fighting".as_slice()) |
| 602 | ); |
| 603 | // Value unchanged. |
| 604 | let val = engine.get(1, "state", b"p1", 1000); |
| 605 | assert_eq!(val.as_deref(), Some(b"fighting".as_slice())); |
| 606 | } |
| 607 | |
| 608 | #[test] |
| 609 | fn getset_new_key() { |
nothing calls this directly
no test coverage detected