refactor(tests): prefer link-index in structure collection golds

Move collection-* structure fixtures to [key](base), and modernize
public/stdlib table/fs/time demos with bracket-marked library calls.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-14 13:03:03 +08:00
1 parent d55567a634
commit ac3f0633cd
13 files changed
+49 -49

No files matched your search

+6
View File
@@ -44,6 +44,12 @@
`` `菜单`[^拿铁] `` / `菜单[^拿铁]` → `[拿铁](菜单)`(**基与键左右对调**)。
| 区域 | 约定 |
|------|------|
| 新代码 / examples / public | **只用**链接形 |
| `tests/structure/footnote*` · `interp-footnote*` | 脚注兼容门禁(保留) |
| 其余 structure / ext / lib 金样 | 已迁链接形 |
脚注路径保留至另行决定移除之日;Skill / 教程 / 新示例只用链接形。
## 4. 非目标
+2
View File
@@ -28,6 +28,7 @@
| **M3–M4** | `ext/web`、`ext/ai`:脚注→链接取元;叙述;示例可逐步换括号调用 | **done**(取元迁移) |
| **M5** | quantum / linalg + full gold | **done** |
| **M6** | examples + public/structure + tests/ext·lib 链接取元;cafe 括号调用例 | **done** |
| **M7** | structure collection 金样改链接形;public/stdlib 括号调用例 | **done** |
## 2. 验收(出门)
@@ -46,3 +47,4 @@
| 2026-09-14 | M3–M4 ext/web+ai 脚注→链接取元 |
| 2026-09-14 | M5 quantum/linalg 叙述 + public/features 取元 |
| 2026-09-14 | M6 examples/public/tests 批量链接取元 + cafe 括号调用 |
| 2026-09-14 | M7 structure collection 金样 + stdlib 括号调用例 |
+4 -6
View File
@@ -6,13 +6,11 @@ import fs:lib/fs.mq.md
# main
Import lib/fs.mq.md. Functions: read_text, write_text, append_text, exists, list_dir, make_dir, remove (path / text params).
Filesystem helpers from lib/fs. Bare path words must not contain `/` (division). Prefer a same-folder name or a variable.
Bare path words must not contain a slash character (parsed as division). Prefer a same-folder name or a variable.
**`ok` = > fs.exists path="demo.txt"**
**`ok` = [fs.exists] path="demo.txt"**
1. `ok`
> print text=demo-present
**打印 内容="demo-present"**
2. *
> print text=demo-missing
**打印 内容="demo-missing"**
+1 -1
View File
@@ -19,7 +19,7 @@ Read with link-index get. Use json for parse/stringify only.
| b |
**`xs` = [table.put] in=`xs` at=1 value="A"**
**`n` = > table.rows xs=`xs`**
**`n` = [table.rows] xs=`xs`**
**打印 内容=[Authorization](h)**
**打印 内容=[1](xs)**
+6 -8
View File
@@ -6,14 +6,12 @@ import time:lib/time.mq.md
# main
Import lib/time.mq.md. Functions: now_unix, now_ms, format(unix, pattern), parse(text, pattern), sleep_ms(ms). Patterns use strftime.
Unix time helpers from lib/time. Patterns use strftime.
**`s` = > time.format unix=0 pattern="%Y-%m-%d"**
**`s` = [time.format] unix=0 pattern="%Y-%m-%d"**
**打印 内容=`s`**
> print text=`s`
**`u` = [time.parse] text="1970-01-01 00:00:00" pattern="%Y-%m-%d %H:%M:%S"**
**打印 内容=`u`**
**`u` = > time.parse text="1970-01-01 00:00:00" pattern="%Y-%m-%d %H:%M:%S"**
> print text=`u`
> time.sleep_ms ms=0
**[time.sleep_ms] ms=0**
+4 -6
View File
@@ -6,13 +6,11 @@ description: 沙箱内读写文本
# main
导入 lib/文件.mq.md。函数:读文本、写文本、追加文本、存在、列目录、建目录、删除。
文件系统助手(lib/文件)。裸路径不要写斜杠(会被当成除法)。可用同目录文件名或变量。
裸路径字面量不要写斜杠(会被当成除法)。可用同目录文件名或变量。
**`ok` = > 文件.存在 路径="demo.txt"**
**`ok` = [文件.存在] 路径="demo.txt"**
1. `ok`
> 打印 内容=有演示文件
**打印 内容="有演示文件"**
2. *
> 打印 内容=无演示文件
**打印 内容="无演示文件"**
+6 -8
View File
@@ -6,14 +6,12 @@ description: Unix 时间、格式化、解析、睡眠
# main
导入 lib/时间.mq.md。函数:此刻秒、此刻毫秒、格式化(秒, 格式)、解析时间(内容, 格式)、睡眠毫秒(毫秒)。格式为 strftime。
Unix 时间助手(lib/时间)。格式为 strftime。
**`s` = > 时间.格式化 秒=0 格式="%Y-%m-%d"**
**`s` = [时间.格式化] 秒=0 格式="%Y-%m-%d"**
**打印 内容=`s`**
> 打印 内容=`s`
**`u` = [时间.解析时间] 内容="1970-01-01 00:00:00" 格式="%Y-%m-%d %H:%M:%S"**
**打印 内容=`u`**
**`u` = > 时间.解析时间 内容="1970-01-01 00:00:00" 格式="%Y-%m-%d %H:%M:%S"**
> 打印 内容=`u`
> 时间.睡眠毫秒 毫秒=0
**[时间.睡眠毫秒] 毫秒=0**
+2 -2
View File
@@ -16,8 +16,8 @@ description: 改 / 行数 / 取行(代码即文档试点)
| 乙 |
**`xs` = [表.改] 入=`xs` 于=1 值="甲改"**
**`n` = > 表.行数 xs=`xs`**
**`r` = > 表.取行 xs=`xs` i=0**
**`n` = [表.行数] xs=`xs`**
**`r` = [表.取行] xs=`xs` i=0**
**打印 内容=[1](xs)**
**打印 内容=`n`**
+7 -7
View File
@@ -14,9 +14,9 @@ description: Data cells evaluate like call-arg values (`var`, paths, hyphen pros
|---------|-------|------|
| `secret` | `name` | https://api.openai.com/v1 |
> print text=`cfg`[^api_key]
> print text=`cfg`[^model]
> print text=`cfg`[^base]
> print text=[api_key](`cfg`)
> print text=[model](`cfg`)
> print text=[base](`cfg`)
`paths` =
@@ -24,7 +24,7 @@ description: Data cells evaluate like call-arg values (`var`, paths, hyphen pros
|---|
| /chat/completions |
> print text=`paths`[^1]
> print text=[1](`paths`)
`rec` =
@@ -32,7 +32,7 @@ description: Data cells evaluate like call-arg values (`var`, paths, hyphen pros
|---|------|---------|
| 1 | user | `secret` |
> print text=`rec`[^1][^content]
> print text=[content]([1](`rec`))
`ratios` =
@@ -41,5 +41,5 @@ description: Data cells evaluate like call-arg values (`var`, paths, hyphen pros
| "1/5" |
| "16/9" |
> print text=`ratios`[^1]
> print text=`ratios`[^2]
> print text=[1](`ratios`)
> print text=[2](`ratios`)
+3 -3
View File
@@ -11,14 +11,14 @@ title: 横表多行 → 字典套列表
| 红富士 | 青瓜 |
| 嘎啦 | 黄瓜条 |
**第一种苹果 = 货架[^苹果][^1]**
**第一种苹果 = [1]([苹果](货架))**
> print text=`第一种苹果`
**列 = 货架[^苹果]**
**列 = [苹果](货架)**
> print text=`列`
**第二种黄瓜 = 货架[^黄瓜][^2]**
**第二种黄瓜 = [2]([黄瓜](货架))**
> print text=`第二种黄瓜`
+3 -3
View File
@@ -10,15 +10,15 @@ title: 横表单行 → 字典
|------|------|------|
| 水果 | 蔬菜 | 数码用品 |
**种 = 分类[^苹果]**
**种 = [苹果](分类)**
> print text=`种`
**种 = 分类[^黄瓜]**
**种 = [黄瓜](分类)**
> print text=`种`
**种 = 分类[^鼠标]**
**种 = [鼠标](分类)**
> print text=`种`
+2 -2
View File
@@ -11,10 +11,10 @@ title: row records with @ marker
| 1 | apple | 2 |
| 2 | pear | 3 |
**n = orders[^1][^name]**
**n = [name]([1](orders))**
> print text=`n`
**q = orders[^2][^qty]**
**q = [qty]([2](orders))**
> print text=`q`
+3 -3
View File
@@ -11,15 +11,15 @@ title: 行向记录表(首列 行 / @)
| 1 | 苹果 | 2 |
| 2 | 梨 | 3 |
**第一 = 订单[^1]**
**第一 = [1](订单)**
> print text=`第一`
**名 = 订单[^1][^品名]**
**名 = [品名]([1](订单))**
> print text=`名`
**量 = 订单[^2][^数量]**
**量 = [数量]([2](订单))**
> print text=`量`