Files
marqdo/tests/ext/web-drivers-smoke.mq.md
T
cflmyandCursor abcb141737 refactor: prefer link-index get across examples and tests
Migrate remaining footnote-style collection access in examples,
public/structure, and ext/lib smokes to [key](base); teach link-index in
structure pages and use bracket calls in the cafe journal example.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 12:54:38 +08:00

1.7 KiB


title: web drivers smoke (W4) description: memory cache + file storage + postgres URL shape (offline). import web:ext/web/web.mq.md import plugin:lib/plugin.mq.md import sys:lib/sys.mq.md

main

p = > plugin.native_path name="web"

  1. p

plugin.load path=p

sys.exit code=1

c = > web.cache url="memory:drivers-smoke"

c.set key="k1" value="v1" ttl=60 g = > c.get key="k1" gv = value

  1. gv == "v1"

print text=cache-ok

print text=cache-fail

c.del key="k1" ex = > c.exists key="k1" eok = ok

  1. eok

print text=cache-del-fail

print text=cache-del-ok

blob = > web.storage url="file:tests/ext/web-fixtures/data/drivers-blobs"

blob.put key="notes/a.txt" body="hello" content_type="text/plain" got = > blob.get key="notes/a.txt" body = body

  1. body == "hello"

print text=storage-ok

print text=storage-fail

ls = > blob.list prefix="notes/" n = count

  1. n == 1

print text=storage-list-ok

print text=storage-list-fail

blob.delete key="notes/a.txt"

pg = > web.db url="postgres://marqdo:marqdo@127.0.0.1:5432/marqdo" purl = url

  1. purl == "postgres://marqdo:marqdo@127.0.0.1:5432/marqdo"

print text=postgres-url-ok

print text=postgres-url-fail

s3 = > web.storage url="s3://bucket?endpoint=http://127.0.0.1:9000" sb = backend

  1. sb == "s3"

print text=s3-open-ok

print text=s3-open-fail