summaryrefslogtreecommitdiff
path: root/storage.test
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2024-10-03 21:08:17 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2024-10-05 10:10:48 +0200
commitde94b20c766cc4006338f12fba0ce19dbbb89251 (patch)
treee80799277f5b74196492e6e05e5d5da80aeabccb /storage.test
parent65c8060e75c91ee083f622b8058d0ba79a34e319 (diff)
(test) Keep unknown items in local state
Changelog: Keep unknown items in local state
Diffstat (limited to 'storage.test')
-rw-r--r--storage.test47
1 files changed, 47 insertions, 0 deletions
diff --git a/storage.test b/storage.test
index 0369807..3d898b1 100644
--- a/storage.test
+++ b/storage.test
@@ -427,3 +427,50 @@ test SharedStateWatcher:
send "shared-state-wait $s2" to p2
expect /shared-state-wait $s1/ from p2
expect /shared-state-wait $s2/ from p2
+
+
+test LocalStateKeepUnknown:
+ let refpat = /blake2#[0-9a-f]*/
+
+ spawn as p
+ with p:
+ send "create-identity Device"
+ send "watch-local-identity"
+ expect /local-identity Device/
+
+ send "local-state-get"
+ expect /local-state-get ($refpat)/ capture s1
+ send "load $s1"
+
+ expect /load-type rec [0-9]*/
+ expect /load-line id:r ($refpat)/ capture id1
+ local:
+ expect /load-(.*)/ capture done
+ guard (done == "done")
+
+ send:
+ "store rec"
+ "id:r $id1"
+ "TEST:i 123"
+ ""
+ expect /store-done ($refpat)/ capture s2
+ send "local-state-replace $s1 $s2"
+ expect /local-state-replace-done/
+
+ send "local-state-get"
+ expect /local-state-get $s2/
+
+ send "update-local-identity Device2"
+ expect /local-identity Device2/
+
+ send "local-state-get"
+ expect /local-state-get ($refpat)/ capture s3
+ send "load $s3"
+
+ expect /load-type rec [0-9]*/
+ expect /load-line id:r ($refpat)/ capture id2
+ guard (id1 /= id2)
+ expect /load-line TEST:i 123/
+ local:
+ expect /load-(.*)/ capture done
+ guard (done == "done")