// The store on one node: what node a sees across the cluster // (crates/louise/tests/dist.rs runs both nodes). import std/actor import std/process.{type proc} import std/test.{assert_equal} import kv.{Get, Put, Size} @test fn the_store_keeps_the_last_value :: -> () / { let store = kv.start () assert_equal (actor.call store fn r { Get("k", r) } 1000) None assert_equal (actor.call store fn r { Put("k", "1", r) } 1000) None assert_equal (actor.call store fn r { Put("k", "2", r) } 1000) Some("1") assert_equal (actor.call store fn r { Get("k", r) } 1000) Some("2") assert_equal (actor.call store Size 1000) 1 }