Skip to content

Commit 2f436fa

Browse files
Merge pull request #96 from riscv/95-update-testadoc-and-expected-tagsrules-now-that-94-is-merged
fix: added test cases to test.adoc and updated expected result files
2 parents 4bf7840 + 776b57b commit 2f436fa

File tree

5 files changed

+272
-88
lines changed

5 files changed

+272
-88
lines changed

tests/norm-rule/expected/test-norm-rules.json

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,75 @@
1818
}
1919
]
2020
},
21+
{
22+
"name": "inline-anchors-in-paragraph",
23+
"def_filename": "tests/norm-rule/test.yaml",
24+
"chapter_name": "my-chapter_name",
25+
"tags": [
26+
{
27+
"name": "norm:paragraph:inline-anchors-in-paragraph",
28+
"text": "Paragraph with inline anchor and something.",
29+
"tag_filename": "/build/test-norm-tags.json"
30+
}
31+
]
32+
},
33+
{
34+
"name": "inline-anchors-in-tagged-paragraph",
35+
"def_filename": "tests/norm-rule/test.yaml",
36+
"chapter_name": "my-chapter_name",
37+
"tags": [
38+
{
39+
"name": "norm:paragraph:inline-anchors-in-paragraph:inline-anchors",
40+
"text": "inline anchor",
41+
"tag_filename": "/build/test-norm-tags.json"
42+
}
43+
]
44+
},
2145
{
2246
"name": "paragraph-with-a-really-wide-rule-name",
2347
"def_filename": "tests/norm-rule/test.yaml",
2448
"chapter_name": "my-chapter_name",
2549
"description": "Here's a description.\nIt's got 2 lines.\n",
2650
"tags": [
2751
{
28-
"name": "norm:para",
29-
"text": "Paragraph anchor",
52+
"name": "norm:paragraph:no-inline-anchors-in-paragraph",
53+
"text": "Paragraph without inline anchors",
54+
"tag_filename": "/build/test-norm-tags.json"
55+
}
56+
]
57+
},
58+
{
59+
"name": "table1",
60+
"def_filename": "tests/norm-rule/test.yaml",
61+
"chapter_name": "my-chapter_name",
62+
"tags": [
63+
{
64+
"name": "norm:table:anchors-in-cells:entire-table",
65+
"text": "===\n cell with anchor\ncell without anchor\n===",
66+
"tag_filename": "/build/test-norm-tags.json"
67+
}
68+
]
69+
},
70+
{
71+
"name": "table2",
72+
"def_filename": "tests/norm-rule/test.yaml",
73+
"chapter_name": "my-chapter_name",
74+
"tags": [
75+
{
76+
"name": "norm:table:no-anchors-in-cells:entire-table",
77+
"text": "Header 1|Header 2\n===\nCell in column 1, row 1|Cell in column 2, row 1\nCell in column 1, row 2|Cell in column 2, row 2\n===",
78+
"tag_filename": "/build/test-norm-tags.json"
79+
}
80+
]
81+
},
82+
{
83+
"name": "unordered1",
84+
"def_filename": "tests/norm-rule/test.yaml",
85+
"chapter_name": "my-chapter_name",
86+
"tags": [
87+
{
88+
"name": "norm:unordered-list:anchors-in-items:entire-list",
89+
"text": "Unordered List with anchors:",
3090
"tag_filename": "/build/test-norm-tags.json"
3191
}
3292
]
@@ -42,13 +102,13 @@
42102
"description": "One line description",
43103
"tags": [
44104
{
45-
"name": "norm:note-1",
46-
"text": "Multi-paragraph note 1",
105+
"name": "norm:admonition:anchors-in-notes:note1",
106+
"text": "Paragraph 1",
47107
"tag_filename": "/build/test-norm-tags.json"
48108
},
49109
{
50-
"name": "norm:note-3",
51-
"text": "Multi-paragraph note 3",
110+
"name": "norm:admonition:anchors-in-notes:note3",
111+
"text": "Paragraph 3",
52112
"tag_filename": "/build/test-norm-tags.json"
53113
}
54114
]
@@ -59,12 +119,12 @@
59119
"chapter_name": "my-chapter_name",
60120
"tags": [
61121
{
62-
"name": "norm:description-item-1",
122+
"name": "norm:description-list:anchors-in-items:item1",
63123
"text": "Description Item 1",
64124
"tag_filename": "/build/test-norm-tags.json"
65125
},
66126
{
67-
"name": "norm:description-item-3",
127+
"name": "norm:description-list:anchors-in-items:item3",
68128
"text": "Description Item 3",
69129
"tag_filename": "/build/test-norm-tags.json"
70130
}
@@ -76,12 +136,12 @@
76136
"chapter_name": "my-chapter_name",
77137
"tags": [
78138
{
79-
"name": "norm:description-item-1",
139+
"name": "norm:description-list:anchors-in-items:item1",
80140
"text": "Description Item 1",
81141
"tag_filename": "/build/test-norm-tags.json"
82142
},
83143
{
84-
"name": "norm:description-item-3",
144+
"name": "norm:description-list:anchors-in-items:item3",
85145
"text": "Description Item 3",
86146
"tag_filename": "/build/test-norm-tags.json"
87147
}
@@ -94,7 +154,7 @@
94154
"tags": [
95155
{
96156
"name": "norm:tag_with_newlines",
97-
"text": "Here’s the first line.\nHere’s the second line.",
157+
"text": "Here’s the first line. Here’s the second line.",
98158
"tag_filename": "/build/test-norm-tags.json"
99159
}
100160
]
325 Bytes
Binary file not shown.

tests/norm-rule/expected/test-norm-tags.json

Lines changed: 93 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,118 @@
11
{
22
"tags": {
33
"norm:inline": "inside inline",
4-
"norm:tag_with_newlines": "Here’s the first line.\nHere’s the second line.",
5-
"norm:para": "Paragraph anchor",
6-
"norm:table-name-empty-tag-just-anchor": "",
7-
"norm:unordered-list-heading": "Unordered List:",
8-
"norm:ordered-list-heading": "Ordered List:",
9-
"norm:description-item-1": "Description Item 1",
10-
"norm:description-item-3": "Description Item 3",
11-
"norm:note-1": "Multi-paragraph note 1",
12-
"norm:note-3": "Multi-paragraph note 3"
4+
"norm:tag_with_newlines": "Here’s the first line. Here’s the second line.",
5+
"norm:paragraph:no-inline-anchors-in-paragraph": "Paragraph without inline anchors",
6+
"norm:paragraph:inline-anchors-in-paragraph:inline-anchors": "inline anchor",
7+
"norm:paragraph:inline-anchors-in-paragraph": "Paragraph with inline anchor and something.",
8+
"norm:table:anchors-in-cells:cell": "",
9+
"norm:table:anchors-in-cells:entire-table": "===\n cell with anchor\ncell without anchor\n===",
10+
"norm:table:no-anchors-in-cells:entire-table": "Header 1|Header 2\n===\nCell in column 1, row 1|Cell in column 2, row 1\nCell in column 1, row 2|Cell in column 2, row 2\n===",
11+
"norm:unordered-list:anchors-in-items:entire-list": "Unordered List with anchors:",
12+
"norm:unordered-list:anchors-in-items:item1": "",
13+
"norm:unordered-list:anchors-in-items:item2": "",
14+
"norm:unordered-list:no-anchors-in-items:entire-list": "Unordered List without anchors:",
15+
"norm:unordered-list:multiple-levels": "Zca and not F\nZca, Zcf and F (but not D) is specified (RV32 only)\nZca, Zcf and Zcd if D is specified (RV32 only)\n\nthis configuration excludes Zcmp, Zcmt\nZca, Zcd if D is specified (RV64 only)\n\nthis configuration excludes Zcmp, Zcmt",
16+
"norm:ordered-list:anchors-in-items:entire-list": "Ordered List with anchors:",
17+
"norm:ordered-list:anchors-in-items:item1": "",
18+
"norm:ordered-list:anchors-in-items:item2": "",
19+
"norm:ordered-list:no-anchors-in-items:entire-list": "Ordered List without anchors:",
20+
"norm:description-list:anchors-in-items:item1": "Description Item 1",
21+
"norm:description-list:anchors-in-items:item3": "Description Item 3",
22+
"norm:description-list:no-anchors-in-items:entire-list": "Description List without anchors in items:",
23+
"norm:admonition:single-paragraph-note": "",
24+
"norm:admonition:anchors-in-notes:note1": "Paragraph 1",
25+
"norm:admonition:anchors-in-notes:note3": "Paragraph 3",
26+
"norm:admonition:anchors-in-notes:entire-note": "Paragraph 1\n\nParagraph 2\n\nParagraph 3",
27+
"norm:admonition:no-anchors-in-notes:entire-note": "Paragraph 1\n\nParagraph 2\n\nParagraph 3",
28+
"norm:admonition:only-anchors-in-notes:note1": "Paragraph 1",
29+
"norm:admonition:only-anchors-in-notes:note3": "Paragraph 3"
1330
},
1431
"sections": {
1532
"title": "",
1633
"id": "",
1734
"children": [
1835
{
19-
"title": "Chapter 1",
20-
"id": "_chapter_1",
36+
"title": "Chapter 1 - Basic Tagging",
37+
"id": "_chapter_1_basic_tagging",
2138
"children": [
2239
{
23-
"title": "Chapter 1.1",
24-
"id": "_chapter_1_1",
40+
"title": "Chapter 1.1 - Inline Tagging",
41+
"id": "_chapter_1_1_inline_tagging",
2542
"children": [],
2643
"tags": [
27-
"norm:para",
28-
"norm:table-name-empty-tag-just-anchor"
44+
"norm:inline",
45+
"norm:tag_with_newlines"
46+
]
47+
},
48+
{
49+
"title": "Chapter 1.2 - Paragraph Tagging",
50+
"id": "_chapter_1_2_paragraph_tagging",
51+
"children": [],
52+
"tags": [
53+
"norm:paragraph:no-inline-anchors-in-paragraph",
54+
"norm:paragraph:inline-anchors-in-paragraph:inline-anchors",
55+
"norm:paragraph:inline-anchors-in-paragraph"
56+
]
57+
},
58+
{
59+
"title": "Chapter 2 - Table Tagging",
60+
"id": "_chapter_2_table_tagging",
61+
"children": [],
62+
"tags": [
63+
"norm:table:anchors-in-cells:cell",
64+
"norm:table:anchors-in-cells:entire-table",
65+
"norm:table:no-anchors-in-cells:entire-table"
2966
]
3067
}
3168
],
69+
"tags": []
70+
},
71+
{
72+
"title": "Chapter 3 - Tagging Unordered Lists",
73+
"id": "_chapter_3_tagging_unordered_lists",
74+
"children": [],
75+
"tags": [
76+
"norm:unordered-list:anchors-in-items:entire-list",
77+
"norm:unordered-list:anchors-in-items:item1",
78+
"norm:unordered-list:anchors-in-items:item2",
79+
"norm:unordered-list:no-anchors-in-items:entire-list",
80+
"norm:unordered-list:multiple-levels"
81+
]
82+
},
83+
{
84+
"title": "Chapter 4 - Tagging Ordered Lists",
85+
"id": "_chapter_4_tagging_ordered_lists",
86+
"children": [],
87+
"tags": [
88+
"norm:ordered-list:anchors-in-items:entire-list",
89+
"norm:ordered-list:anchors-in-items:item1",
90+
"norm:ordered-list:anchors-in-items:item2",
91+
"norm:ordered-list:no-anchors-in-items:entire-list"
92+
]
93+
},
94+
{
95+
"title": "Chapter 5 - Tagging Description Lists",
96+
"id": "_chapter_5_tagging_description_lists",
97+
"children": [],
3298
"tags": [
33-
"norm:inline",
34-
"norm:tag_with_newlines"
99+
"norm:description-list:anchors-in-items:item1",
100+
"norm:description-list:anchors-in-items:item3",
101+
"norm:description-list:no-anchors-in-items:entire-list"
35102
]
36103
},
37104
{
38-
"title": "Chapter 2",
39-
"id": "_chapter_2",
105+
"title": "Chapter 6 - Tagging Admonitions",
106+
"id": "_chapter_6_tagging_admonitions",
40107
"children": [],
41108
"tags": [
42-
"norm:unordered-list-heading",
43-
"norm:ordered-list-heading",
44-
"norm:description-item-1",
45-
"norm:description-item-3",
46-
"norm:note-1",
47-
"norm:note-3"
109+
"norm:admonition:single-paragraph-note",
110+
"norm:admonition:anchors-in-notes:note1",
111+
"norm:admonition:anchors-in-notes:note3",
112+
"norm:admonition:anchors-in-notes:entire-note",
113+
"norm:admonition:no-anchors-in-notes:entire-note",
114+
"norm:admonition:only-anchors-in-notes:note1",
115+
"norm:admonition:only-anchors-in-notes:note3"
48116
]
49117
}
50118
],

0 commit comments

Comments
 (0)