build: update dev config

This commit is contained in:
Richard 2024-09-25 22:10:04 -07:00
parent 4b6739c776
commit 8aef95e2ae
3 changed files with 27 additions and 6 deletions

View file

@ -20,6 +20,13 @@ return function()
local previous = a()
local client = sync.client({ atoms = { a = a } })
client:sync({
type = "init",
data = { a = a() },
})
expect(a()).to.equal(previous)
client:sync({
type = "patch",
data = { a = { b = 3 } },
@ -34,6 +41,11 @@ return function()
local a = atom({ 1 })
local client = sync.client({ atoms = { a = a } })
client:sync({
type = "init",
data = { a = a() },
})
-- This patch would be the result of a diff between { 1 } and { 1, 2 } that
-- was JSON-serialized and deserialized. The client should be able to catch
-- this and convert the string key back to a number.
@ -55,6 +67,11 @@ return function()
table.insert(calls, value)
end)
client:sync({
type = "init",
data = { a = a() },
})
client:sync({
type = "patch",
data = { a = 2 },
@ -82,6 +99,11 @@ return function()
states.a = a()
end)
client:sync({
type = "init",
data = { a = a(), b = b() },
})
client:sync({
type = "patch",
data = { a = 1, b = 2 },