Skip to content

Commit 31caef2

Browse files
committed
update TC
1 parent f852ae2 commit 31caef2

File tree

5 files changed

+137
-0
lines changed

5 files changed

+137
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"filepath": "dummy_1.c",
4+
"remote_url": null,
5+
"source_map": {
6+
"start": {
7+
"row": 2,
8+
"column": 0
9+
},
10+
"end": {
11+
"row": 6,
12+
"column": 59
13+
}
14+
},
15+
"tagged_scope": "int main() {\n return 0;\n}",
16+
"rst": " .. impl:: implement main function\n :id: REQ_001\n :status: test\n\n This is content for the main function implementation.\n ",
17+
"need": {
18+
"type": "impl",
19+
"title": "implement main function",
20+
"content": "This is content for the main function implementation.",
21+
"id": "REQ_001",
22+
"status": "test"
23+
},
24+
"type": "rst"
25+
}
26+
]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"filepath": "dummy_1.c",
4+
"remote_url": null,
5+
"source_map": {
6+
"start": {
7+
"row": 2,
8+
"column": 0
9+
},
10+
"end": {
11+
"row": 6,
12+
"column": 60
13+
}
14+
},
15+
"tagged_scope": "int main() {\n return 0;\n}",
16+
"rst": " .. impl:: implement main function\n :id: REQ_001\n :status: test\n\n This is content for the main function implementation.\n ",
17+
"need": {
18+
"type": "impl",
19+
"title": "implement main function",
20+
"content": "This is content for the main function implementation.",
21+
"id": "REQ_001",
22+
"status": "test"
23+
},
24+
"type": "rst"
25+
}
26+
]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
[
2+
{
3+
"filepath": "dummy_1.c",
4+
"remote_url": null,
5+
"source_map": {
6+
"start": {
7+
"row": 2,
8+
"column": 0
9+
},
10+
"end": {
11+
"row": 6,
12+
"column": 59
13+
}
14+
},
15+
"tagged_scope": "int main() {\n return 0;\n}",
16+
"rst": " .. impl:: implement main function\n :id: REQ_001\n :links: IMPL_001, IMPL_002\n\n This is content for the main function implementation.\n ",
17+
"need": {
18+
"type": "impl",
19+
"title": "implement main function",
20+
"content": "This is content for the main function implementation.",
21+
"id": "REQ_001",
22+
"links": [
23+
"IMPL_001",
24+
" IMPL_002"
25+
]
26+
},
27+
"type": "rst"
28+
}
29+
]

tests/fixture_files/analyse_rst.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,51 @@ multiline_rst_marker:
1919
int main() {
2020
return 0;
2121
}
22+
23+
leading_asterisk_rst_marker:
24+
dummy_1.c: |
25+
/*
26+
* @rst
27+
* .. impl:: implement main function
28+
* :id: REQ_001
29+
* :status: test
30+
*
31+
* This is content for the main function implementation.
32+
* @endrst
33+
*/
34+
int main() {
35+
return 0;
36+
}
37+
38+
leading_asterisks_rst_marker:
39+
marked_rst_config:
40+
strip_leading_sequences:
41+
- '**'
42+
dummy_1.c: |
43+
/**
44+
** @rst
45+
** .. impl:: implement main function
46+
** :id: REQ_001
47+
** :status: test
48+
**
49+
** This is content for the main function implementation.
50+
** @endrst
51+
**/
52+
int main() {
53+
return 0;
54+
}
55+
56+
link_options_rst_marker:
57+
dummy_1.c: |
58+
/*
59+
* @rst
60+
* .. impl:: implement main function
61+
* :id: REQ_001
62+
* :links: IMPL_001, IMPL_002
63+
*
64+
* This is content for the main function implementation.
65+
* @endrst
66+
*/
67+
int main() {
68+
return 0;
69+
}

tests/test_analyse.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ def test_analyse_rst(
148148
get_rst=True,
149149
)
150150

151+
if "marked_rst_config" in content:
152+
src_analyse_config.marked_rst_config.strip_leading_sequences = content[
153+
"marked_rst_config"
154+
].get(
155+
"strip_leading_sequences",
156+
src_analyse_config.marked_rst_config.strip_leading_sequences,
157+
)
158+
151159
src_analyse = SourceAnalyse(src_analyse_config)
152160
src_analyse.run()
153161
src_analyse.dump_marked_content(tmp_path)

0 commit comments

Comments
 (0)