MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_view_state_simulate_apply

Function test_view_state_simulate_apply

atomic-core/src/apply/change.rs:431–443  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

429
430 #[test]
431 fn test_view_state_simulate_apply() {
432 let mut view = ViewState::new(1, "feature".to_string());
433 let change_hash = test_hash();
434
435 // Simulate what apply does
436 let new_state = compute_new_state(&view.state, &change_hash);
437 view.state = new_state;
438 view.change_count += 1;
439
440 assert_eq!(view.change_count, 1);
441 assert!(!view.is_empty());
442 assert_eq!(view.state, new_state);
443 }
444
445 #[test]
446 fn test_view_state_multiple_applies() {

Callers

nothing calls this directly

Calls 2

compute_new_stateFunction · 0.85
test_hashFunction · 0.70

Tested by

no test coverage detected