summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-10-08 23:06:24 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2025-10-08 23:06:24 +0200
commit818688ab0242a5d4329f9a690e6c119e4b3d34da (patch)
treea415c9d45cdd182985806d42e05dde2f2afb6f5d /test
parent3399d09c698953dfda8935eda8b87f1c402ae785 (diff)
Handle invalid record objects
Changelog: Gracefully handle invalid record objects
Diffstat (limited to 'test')
-rw-r--r--test/storage.et22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/storage.et b/test/storage.et
index 9bbbe6b..035a64b 100644
--- a/test/storage.et
+++ b/test/storage.et
@@ -566,6 +566,28 @@ test ObjectFormat:
expect /load-type (.*)/ capture type
guard (type == "rec")
+ # Record with unknown type
+ local:
+ send "store-raw EOF"
+ send "rec 14\nnum:UNKNOWN 1\n"
+ send "EOF"
+ expect /store-done ($refpat)/ capture r
+
+ send "load-type $r"
+ expect /load-type (.*)/ capture type
+ guard (type == "rec")
+
+ # Invalid records
+ for content in [ "rec 6\nnum 1\n", "rec 6\nnum:n\n" ]:
+ send "store-raw EOF"
+ send "$content"
+ send "EOF"
+ expect /store-done ($refpat)/ capture r
+
+ send "load-type $r"
+ expect /load-type (.*)/ capture type
+ guard (type == "unknown rec")
+
# Empty unknown
local:
send "store-raw EOF"