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:507–519  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

505
506 #[test]
507 fn test_view_state_simulate_apply() {
508 let mut view = ViewState::new(1, "feature".to_string());
509 let change_hash = test_hash();
510
511 // Simulate what apply does
512 let new_state = compute_new_state(&view.state, &change_hash);
513 view.state = new_state;
514 view.change_count += 1;
515
516 assert_eq!(view.change_count, 1);
517 assert!(!view.is_empty());
518 assert_eq!(view.state, new_state);
519 }
520
521 #[test]
522 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