Implement marqdo-ext-http#3: the explicit @http package now owns a real
loopback domain test instead of only pure encode/parse cases.
- tests/loopback.mq.md performs two real HTTP/1.1 exchanges in one program
through the CLI's generic resource.open("tcp")/read/write/close, building
requests with http.构建请求字节 and parsing responses with
http.解析响应字节; non-ASCII bodies, explicit --allow-net 127.0.0.1 and
--allow-env HTTP_TEST_PORT only.
- scripts/loopback_server.py is a deterministic one-request-per-connection
server that records method/path/body and returns fixed status/bodies.
- scripts/run_cases.py supports kind=loopback (server lifecycle, port env,
grants, request-record assertions) without changing the pure case path.
- tests/cases/loopback.json asserts GET /one -> 200 第一个 and
POST /two -> 201 第二个 plus the request records.
- Evidence: docs/evidence-2026-11-30-loopback-domain-test.md (real CLI rc.6
candidate + Bundle 0.3.0: 2 cases PASS).
No CLI/Host/other-component change, no new Host request, no release.
63 lines
1013 B
JSON
63 lines
1013 B
JSON
{
|
|
"schema": "marqdo.package-test-case",
|
|
"schema_version": 1,
|
|
"name": "loopback",
|
|
"kind": "loopback",
|
|
"file": "loopback.mq.md",
|
|
"dep_alias": "http",
|
|
"requests": 2,
|
|
"grants": [
|
|
"127.0.0.1"
|
|
],
|
|
"args": [],
|
|
"stdin": "",
|
|
"env": {},
|
|
"expected_stdout": "",
|
|
"expected_terminal": {
|
|
"type": "list",
|
|
"items": [
|
|
{
|
|
"type": "bool",
|
|
"value": true
|
|
},
|
|
{
|
|
"type": "int",
|
|
"decimal": "200"
|
|
},
|
|
{
|
|
"type": "text",
|
|
"value": "第一个"
|
|
},
|
|
{
|
|
"type": "bool",
|
|
"value": true
|
|
},
|
|
{
|
|
"type": "int",
|
|
"decimal": "201"
|
|
},
|
|
{
|
|
"type": "text",
|
|
"value": "第二个"
|
|
}
|
|
]
|
|
},
|
|
"request_asserts": {
|
|
"requests": [
|
|
{
|
|
"method": "GET",
|
|
"path": "/one",
|
|
"body": ""
|
|
},
|
|
{
|
|
"method": "POST",
|
|
"path": "/two",
|
|
"body": "ok"
|
|
}
|
|
]
|
|
},
|
|
"allow_env": [
|
|
"HTTP_TEST_PORT"
|
|
]
|
|
}
|