mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 13:00:44 +00:00
docs-i18n: add behavior baseline fixtures (#64073)
Merged via squash.
Prepared head SHA: 4ccd4c5fc0
Co-authored-by: hxy91819 <8814856+hxy91819@users.noreply.github.com>
Co-authored-by: hxy91819 <8814856+hxy91819@users.noreply.github.com>
Reviewed-by: @hxy91819
This commit is contained in:
24
scripts/docs-i18n/testdata/behavior/fenced-singleton-retry/case.json
vendored
Normal file
24
scripts/docs-i18n/testdata/behavior/fenced-singleton-retry/case.json
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "fenced singleton retries after malformed raw output",
|
||||
"mode": "doc_body_chunked",
|
||||
"rel_path": "gateway/configuration-reference.md",
|
||||
"source_file": "source.txt",
|
||||
"expected_output_contains": [
|
||||
"Translated line 01",
|
||||
"Translated line 02",
|
||||
"Translated line 03",
|
||||
"Translated line 04"
|
||||
],
|
||||
"expected_output_not_contains": ["Line 01", "Line 02", "Line 03", "Line 04"],
|
||||
"rules": [
|
||||
{
|
||||
"method": "raw",
|
||||
"match_all": ["Line 01", "Line 04"],
|
||||
"response_file": "raw-malformed.txt"
|
||||
},
|
||||
{
|
||||
"method": "raw",
|
||||
"replace_pairs": [{ "from": "Line ", "to": "Translated line " }]
|
||||
}
|
||||
]
|
||||
}
|
||||
6
scripts/docs-i18n/testdata/behavior/fenced-singleton-retry/raw-malformed.txt
vendored
Normal file
6
scripts/docs-i18n/testdata/behavior/fenced-singleton-retry/raw-malformed.txt
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
```md
|
||||
Line 01
|
||||
Line 02
|
||||
Line 03
|
||||
Line 04
|
||||
|
||||
7
scripts/docs-i18n/testdata/behavior/fenced-singleton-retry/source.txt
vendored
Normal file
7
scripts/docs-i18n/testdata/behavior/fenced-singleton-retry/source.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
```md
|
||||
Line 01
|
||||
Line 02
|
||||
Line 03
|
||||
Line 04
|
||||
```
|
||||
|
||||
14
scripts/docs-i18n/testdata/behavior/frontmatter-fallback/case.json
vendored
Normal file
14
scripts/docs-i18n/testdata/behavior/frontmatter-fallback/case.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "frontmatter scalar falls back instead of keeping tagged wrapper",
|
||||
"mode": "frontmatter_scalar",
|
||||
"rel_path": "install/fly.md",
|
||||
"source_file": "source.txt",
|
||||
"expected_file": "expected.txt",
|
||||
"rules": [
|
||||
{
|
||||
"method": "masked",
|
||||
"match_all": ["Deploying OpenClaw on Fly.io"],
|
||||
"response_file": "masked-tagged-wrapper.txt"
|
||||
}
|
||||
]
|
||||
}
|
||||
1
scripts/docs-i18n/testdata/behavior/frontmatter-fallback/expected.txt
vendored
Normal file
1
scripts/docs-i18n/testdata/behavior/frontmatter-fallback/expected.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Deploying OpenClaw on Fly.io
|
||||
7
scripts/docs-i18n/testdata/behavior/frontmatter-fallback/masked-tagged-wrapper.txt
vendored
Normal file
7
scripts/docs-i18n/testdata/behavior/frontmatter-fallback/masked-tagged-wrapper.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<frontmatter>
|
||||
title: Fly.io
|
||||
</frontmatter>
|
||||
|
||||
<body>
|
||||
# Fly.io 部署
|
||||
</body>
|
||||
1
scripts/docs-i18n/testdata/behavior/frontmatter-fallback/source.txt
vendored
Normal file
1
scripts/docs-i18n/testdata/behavior/frontmatter-fallback/source.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Deploying OpenClaw on Fly.io
|
||||
25
scripts/docs-i18n/testdata/behavior/protocol-leak-split/case.json
vendored
Normal file
25
scripts/docs-i18n/testdata/behavior/protocol-leak-split/case.json
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "protocol leak retries on smaller chunks",
|
||||
"mode": "doc_body_chunked",
|
||||
"rel_path": "gateway/configuration-reference.md",
|
||||
"source_file": "source.txt",
|
||||
"expected_file": "expected.txt",
|
||||
"expected_output_not_contains": ["<frontmatter>", "<body>", "[[[FM_"],
|
||||
"rules": [
|
||||
{
|
||||
"method": "raw",
|
||||
"match_all": ["First chunk", "Second chunk"],
|
||||
"response_file": "raw-leaked.txt"
|
||||
},
|
||||
{
|
||||
"method": "raw",
|
||||
"match_all": ["First chunk"],
|
||||
"response_file": "raw-first.txt"
|
||||
},
|
||||
{
|
||||
"method": "raw",
|
||||
"match_all": ["Second chunk"],
|
||||
"response_file": "raw-second.txt"
|
||||
}
|
||||
]
|
||||
}
|
||||
4
scripts/docs-i18n/testdata/behavior/protocol-leak-split/expected.txt
vendored
Normal file
4
scripts/docs-i18n/testdata/behavior/protocol-leak-split/expected.txt
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
First translated
|
||||
|
||||
Second translated
|
||||
|
||||
2
scripts/docs-i18n/testdata/behavior/protocol-leak-split/raw-first.txt
vendored
Normal file
2
scripts/docs-i18n/testdata/behavior/protocol-leak-split/raw-first.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
First translated
|
||||
|
||||
9
scripts/docs-i18n/testdata/behavior/protocol-leak-split/raw-leaked.txt
vendored
Normal file
9
scripts/docs-i18n/testdata/behavior/protocol-leak-split/raw-leaked.txt
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<frontmatter>
|
||||
title: leaked
|
||||
</frontmatter>
|
||||
|
||||
<body>
|
||||
First translated
|
||||
|
||||
Second translated
|
||||
</body>
|
||||
2
scripts/docs-i18n/testdata/behavior/protocol-leak-split/raw-second.txt
vendored
Normal file
2
scripts/docs-i18n/testdata/behavior/protocol-leak-split/raw-second.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
Second translated
|
||||
|
||||
4
scripts/docs-i18n/testdata/behavior/protocol-leak-split/source.txt
vendored
Normal file
4
scripts/docs-i18n/testdata/behavior/protocol-leak-split/source.txt
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
First chunk
|
||||
|
||||
Second chunk
|
||||
|
||||
14
scripts/docs-i18n/testdata/behavior/uppercase-wrapper-strip/case.json
vendored
Normal file
14
scripts/docs-i18n/testdata/behavior/uppercase-wrapper-strip/case.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "uppercase body wrapper is stripped",
|
||||
"mode": "doc_body_chunked",
|
||||
"rel_path": "help/testing.md",
|
||||
"source_file": "source.txt",
|
||||
"expected_file": "expected.txt",
|
||||
"rules": [
|
||||
{
|
||||
"method": "raw",
|
||||
"match_all": ["Regular paragraph."],
|
||||
"response_file": "raw-uppercase-wrapper.txt"
|
||||
}
|
||||
]
|
||||
}
|
||||
1
scripts/docs-i18n/testdata/behavior/uppercase-wrapper-strip/expected.txt
vendored
Normal file
1
scripts/docs-i18n/testdata/behavior/uppercase-wrapper-strip/expected.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Translated paragraph.
|
||||
3
scripts/docs-i18n/testdata/behavior/uppercase-wrapper-strip/raw-uppercase-wrapper.txt
vendored
Normal file
3
scripts/docs-i18n/testdata/behavior/uppercase-wrapper-strip/raw-uppercase-wrapper.txt
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<BODY>
|
||||
Translated paragraph.
|
||||
</BODY>
|
||||
1
scripts/docs-i18n/testdata/behavior/uppercase-wrapper-strip/source.txt
vendored
Normal file
1
scripts/docs-i18n/testdata/behavior/uppercase-wrapper-strip/source.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Regular paragraph.
|
||||
Reference in New Issue
Block a user