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:
1 parent
d55567a634
commit
ac3f0633cd
13 files changed
+49
-49
No files matched your search
@@ -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"**
|
||||
@@ -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,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**
|
||||
@@ -6,13 +6,11 @@ description: 沙箱内读写文本
|
||||
|
||||
# main
|
||||
|
||||
导入 lib/文件.mq.md。函数:读文本、写文本、追加文本、存在、列目录、建目录、删除。
|
||||
文件系统助手(lib/文件)。裸路径不要写斜杠(会被当成除法)。可用同目录文件名或变量。
|
||||
|
||||
裸路径字面量不要写斜杠(会被当成除法)。可用同目录文件名或变量。
|
||||
|
||||
**`ok` = > 文件.存在 路径="demo.txt"**
|
||||
**`ok` = [文件.存在] 路径="demo.txt"**
|
||||
|
||||
1. `ok`
|
||||
> 打印 内容=有演示文件
|
||||
**打印 内容="有演示文件"**
|
||||
2. *
|
||||
> 打印 内容=无演示文件
|
||||
**打印 内容="无演示文件"**
|
||||
@@ -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**
|
||||
@@ -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`**
|
||||
|
||||
Reference in new issue
Block a user