test(stdlib): cover every bundled module through std imports

This commit is contained in:
Marqdo Agent committed 2026-11-21 01:50:01 +08:00
1 parent a8ccac9e67
commit 04eae8746e
13 files changed
+246 -5

No files matched your search

+2 -1
View File
@@ -13,7 +13,8 @@ module; a mismatch is a hard error.
- `demo.mq.md` — side-by-side comparison with builtin `打印`
- `data/table.mq.md` — value-returning table select/filter/sort/append/set/join/group/GFM
- `net/http.mq.md` — HTTP/1.1 response parsing (headers/chunked) and request builder
- `tests/` — bundle self-tests
- `tests/` — product self-tests for every public module
(`console`, `format`, `http`, `io`, `stream`, `table`, `text`, `utf8`)
The digest is a SHA-256 over sorted `*.mq.md` relative paths, a NUL, file
bytes, and a NUL. It excludes `stdlib.json` and non-`.mq.md` files. After any
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "marqdo-stdlib",
"version": "0.1.0",
"digest": "sha256:bf11fbdd5fedcaf596308630bdd9590600d9ffac6658c9af483215b4b91aa13f"
"digest": "sha256:86edd79cb84057dba847cc66136a6d6a647d44ea889fff537bd8d162707a3285"
}
+10
View File
@@ -0,0 +1,10 @@
---
import:
console: "std:io/console"
---
## main
**行 = console.读取行()**
*[行.ok, 行.value]*
+8
View File
@@ -0,0 +1,8 @@
---
import:
format: "std:format"
---
## main
*[format.字节长度("Aé"), format.显示(["文本", 2, 1.5]), format.显示({a: 1}), format.列表显示(["a", 2]), format.显示(None)]*
+10
View File
@@ -0,0 +1,10 @@
---
import:
stream: "std:io/stream"
---
## main
**结果 = stream.写文本("stream\n")**
*[结果.ok, 结果.value.count]*
+12
View File
@@ -0,0 +1,12 @@
---
import:
text: "std:text"
---
## main
**内存 = memory.new(1, 1)**
**长度 = text.utf8编码("é", 内存, 0)**
*[长度, 内存[0], 内存[1]]*
+12
View File
@@ -0,0 +1,12 @@
---
import:
utf8: "std:text/utf8"
---
## main
**内存 = memory.new(1, 1)**
**长度 = utf8.编码("é", 内存, 0)**
*[长度, utf8.解码(内存, 0, 长度).value, utf8.解码(内存, 0, 1).ok]*