fix: GAP-06–10 parser, invoke Null, exec capture, SSE headers
Recover ## bodies after bad *…* terminators; bracket-aware call args;
invoke Null is 500 not fake ok; sys.exec capture={code,stdout,stderr};
proxy stream sets anti-buffer headers.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
68c4f8c822
commit
1637acce6e
14 files changed
+389
-45
No files matched your search
+16
-8
@@ -189,18 +189,16 @@ sk-live
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn structure_bare_id_italic_bold() {
|
||||
fn structure_gap_star_json_body() {
|
||||
assert_out(
|
||||
"tests/structure/bare-id-italic-bold.mq.md",
|
||||
"2
|
||||
2
|
||||
quoted
|
||||
7
|
||||
ok
|
||||
hi",
|
||||
"tests/structure/gap-star-json-body.mq.md",
|
||||
"1
|
||||
1
|
||||
7",
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn structure_footnote_index() {
|
||||
assert_out(
|
||||
@@ -1323,6 +1321,16 @@ fn lib_sys_cwd() {
|
||||
assert_out("tests/lib/sys-cwd.mq.md", "cwd-ok");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lib_sys_exec_capture() {
|
||||
assert_out(
|
||||
"tests/lib/sys-exec-capture.mq.md",
|
||||
"exec-code-ok
|
||||
capture-code-ok
|
||||
capture-stdout-ok",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lib_sys_dotenv() {
|
||||
assert_out("tests/lib/sys-dotenv.mq.md", "loaded");
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
title: sys.exec capture=True returns stdout map
|
||||
description: GAP-09 optional capture.
|
||||
import sys:lib/sys.mq.md
|
||||
import json:lib/json.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
*code = > sys.exec cmd="true"*
|
||||
1. `code` == 0
|
||||
> print text=exec-code-ok
|
||||
2. *
|
||||
> print text=exec-code-fail
|
||||
|
||||
*args = > json.parse text=["-c","printf hi-capture"]*
|
||||
*out = > sys.exec cmd="sh" args=args capture=True*
|
||||
*c = out[^code]*
|
||||
*s = out[^stdout]*
|
||||
1. `c` == 0
|
||||
> print text=capture-code-ok
|
||||
2. *
|
||||
> print text=capture-code-fail
|
||||
|
||||
1. `s` == "hi-capture"
|
||||
> print text=capture-stdout-ok
|
||||
2. *
|
||||
> print text=capture-stdout-fail
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
title: GAP-06/07 star + JSON array body keep following stmts
|
||||
description: Nested args=`args` and text=["…"] must not truncate the ## body.
|
||||
import json:lib/json.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
*a = > case_backtick*
|
||||
*b = > case_json_array*
|
||||
*c = > case_recover*
|
||||
> print text=`a`
|
||||
> print text=`b`
|
||||
> print text=`c`
|
||||
|
||||
## case_backtick
|
||||
|
||||
`args` =
|
||||
|
||||
| x |
|
||||
|---|
|
||||
| ok |
|
||||
|
||||
*code = > len value=`args`*
|
||||
*y = 1*
|
||||
**y**
|
||||
|
||||
## case_json_array
|
||||
|
||||
*xs = > json.parse text=["scripts/legacy/web_search.py"]*
|
||||
*n = > len value=`xs`*
|
||||
**n**
|
||||
|
||||
## case_recover
|
||||
|
||||
故意少写闭合星号,后续语句仍须可执行:
|
||||
|
||||
*c = > json.parse text=[]`
|
||||
*z = 7*
|
||||
**z**
|
||||
Reference in new issue
Block a user