metanorma-iso 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -4
- data/lib/asciidoctor/iso/base.rb +12 -12
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/isodoc.rng +19 -1
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +6 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/spec/asciidoctor-iso/amd_spec.rb +575 -573
- data/spec/asciidoctor-iso/base_spec.rb +445 -454
- data/spec/asciidoctor-iso/blocks_spec.rb +333 -288
- data/spec/asciidoctor-iso/cleanup_spec.rb +813 -704
- data/spec/asciidoctor-iso/inline_spec.rb +116 -91
- data/spec/asciidoctor-iso/lists_spec.rb +128 -121
- data/spec/asciidoctor-iso/refs_spec.rb +308 -250
- data/spec/asciidoctor-iso/section_spec.rb +273 -242
- data/spec/asciidoctor-iso/table_spec.rb +258 -242
- data/spec/asciidoctor-iso/validate_spec.rb +1099 -1165
- data/spec/isodoc/amd_spec.rb +967 -946
- data/spec/isodoc/blocks_spec.rb +530 -507
- data/spec/isodoc/i18n_spec.rb +953 -911
- data/spec/isodoc/inline_spec.rb +355 -293
- data/spec/isodoc/iso_spec.rb +338 -314
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +833 -656
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +608 -525
- data/spec/isodoc/table_spec.rb +472 -411
- data/spec/isodoc/terms_spec.rb +209 -185
- data/spec/isodoc/xref_spec.rb +1370 -1236
- data/spec/metanorma/processor_spec.rb +28 -26
- data/spec/spec_helper.rb +176 -193
- metadata +2 -4
- data/.rubocop.ribose.yml +0 -66
- data/spec/assets/xref_error.adoc +0 -7
@@ -3,31 +3,28 @@ require "fileutils"
|
|
3
3
|
|
4
4
|
RSpec.describe Asciidoctor::ISO do
|
5
5
|
context "when xref_error.adoc compilation" do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
next if file.match?(/adoc$/)
|
6
|
+
it "generates error file" do
|
7
|
+
File.write("xref_error.adoc", <<~"CONTENT")
|
8
|
+
= X
|
9
|
+
A
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
== Clause
|
12
|
+
|
13
|
+
<<a,b>>
|
14
|
+
CONTENT
|
15
15
|
|
16
|
-
it "generates error file" do
|
17
16
|
expect do
|
18
17
|
mock_pdf
|
19
|
-
mock_sts
|
20
18
|
Metanorma::Compile
|
21
19
|
.new
|
22
|
-
.compile("
|
23
|
-
end.to(change { File.exist?("
|
20
|
+
.compile("xref_error.adoc", type: "iso", no_install_fonts: true)
|
21
|
+
end.to(change { File.exist?("xref_error.err") }
|
24
22
|
.from(false).to(true))
|
25
23
|
end
|
26
24
|
end
|
27
25
|
|
28
|
-
it "Warns of image names not compliant with DRG" do
|
29
|
-
|
30
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
26
|
+
it "Warns of image names not compliant with DRG" do
|
27
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
31
28
|
= Document title
|
32
29
|
Author
|
33
30
|
:docfile: test.adoc
|
@@ -48,7 +45,7 @@ it "Warns of image names not compliant with DRG" do
|
|
48
45
|
|===
|
49
46
|
|a |b
|
50
47
|
|
51
|
-
a|image::spec/examples/rice_images/1000-1_ed2amd3figTab1.png[]
|
48
|
+
a|image::spec/examples/rice_images/1000-1_ed2amd3figTab1.png[]#{' '}
|
52
49
|
a|image::spec/examples/rice_images/1000-1_ed2amd3fig2.png[]
|
53
50
|
|===
|
54
51
|
|
@@ -71,385 +68,399 @@ it "Warns of image names not compliant with DRG" do
|
|
71
68
|
image::spec/examples/rice_images/1000-1_ed2amd3figA2.png[]
|
72
69
|
image::spec/examples/rice_images/1000-1_ed2amd3fig3.png[]
|
73
70
|
|
71
|
+
INPUT
|
72
|
+
expect(File.read("test.err")).to include \
|
73
|
+
"image name spec/examples/rice_images/rice_image1.png does not match DRG requirements: expect 1000-1_ed2amd3fig"
|
74
|
+
expect(File.read("test.err")).to include \
|
75
|
+
"image name spec/examples/rice_images/1001_ed2amd3fig1.png does not match DRG requirements: " \
|
76
|
+
"expect 1000-1_ed2amd3fig"
|
77
|
+
expect(File.read("test.err")).not_to include \
|
78
|
+
"image name spec/examples/rice_images/SL1000-1_ed2amd3fig1.png does not match DRG requirements: " \
|
79
|
+
"expect 1000-1_ed2amd3fig"
|
80
|
+
expect(File.read("test.err")).not_to include \
|
81
|
+
"image name spec/examples/rice_images/ISO_1213_1.png does not match DRG requirements: expect 1000-1_ed2amd3fig"
|
82
|
+
expect(File.read("test.err")).to include \
|
83
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figA.png does not match DRG requirements"
|
84
|
+
expect(File.read("test.err")).not_to include \
|
85
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png does not match DRG requirements"
|
86
|
+
expect(File.read("test.err")).not_to include \
|
87
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png is under a table but is not so labelled"
|
88
|
+
expect(File.read("test.err")).to include \
|
89
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig2.png is under a table but is not so labelled"
|
90
|
+
expect(File.read("test.err")).to include \
|
91
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figTab2.png is labelled as under a table but is not"
|
92
|
+
expect(File.read("test.err")).not_to include \
|
93
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is labelled as under a table but is not"
|
94
|
+
expect(File.read("test.err")).not_to include \
|
95
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figA2.png is under an annex but is not so labelled"
|
96
|
+
expect(File.read("test.err")).to include \
|
97
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig3.png is under an annex but is not so labelled"
|
98
|
+
expect(File.read("test.err")).to include \
|
99
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3figA1.png is labelled as under an annex but is not"
|
100
|
+
expect(File.read("test.err")).not_to include \
|
101
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is labelled as under an annex but is not"
|
102
|
+
expect(File.read("test.err")).not_to include \
|
103
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1b.png has a subfigure letter but is not a subfigure"
|
104
|
+
expect(File.read("test.err")).to include \
|
105
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig4.png does not have a subfigure letter but is a subfigure"
|
106
|
+
expect(File.read("test.err")).to include \
|
107
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1a.png has a subfigure letter but is not a subfigure"
|
108
|
+
expect(File.read("test.err")).not_to include \
|
109
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png has a subfigure letter but is not a subfigure"
|
110
|
+
expect(File.read("test.err")).to include \
|
111
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig5_f.png expected to have suffix _e"
|
112
|
+
expect(File.read("test.err")).not_to include \
|
113
|
+
"image name spec/examples/rice_images/1000-1_ed2amd3fig1.png expected to have suffix _e"
|
114
|
+
end
|
115
|
+
|
116
|
+
context "Warns of missing scope" do
|
117
|
+
it "Scope clause missing" do
|
118
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
119
|
+
= Document title
|
120
|
+
Author
|
121
|
+
:docfile: test.adoc
|
122
|
+
:nodoc:
|
123
|
+
:no-isobib:
|
124
|
+
:doctype: pizza
|
125
|
+
|
126
|
+
text
|
74
127
|
INPUT
|
75
|
-
expect(File.read("test.err")).to include "image name spec/examples/rice_images/rice_image1.png does not match DRG requirements: expect 1000-1_ed2amd3fig"
|
76
|
-
expect(File.read("test.err")).to include "image name spec/examples/rice_images/1001_ed2amd3fig1.png does not match DRG requirements: expect 1000-1_ed2amd3fig"
|
77
|
-
expect(File.read("test.err")).not_to include "image name spec/examples/rice_images/SL1000-1_ed2amd3fig1.png does not match DRG requirements: expect 1000-1_ed2amd3fig"
|
78
|
-
expect(File.read("test.err")).not_to include "image name spec/examples/rice_images/ISO_1213_1.png does not match DRG requirements: expect 1000-1_ed2amd3fig"
|
79
|
-
expect(File.read("test.err")).to include "image name spec/examples/rice_images/1000-1_ed2amd3figA.png does not match DRG requirements"
|
80
|
-
expect(File.read("test.err")).not_to include "image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png does not match DRG requirements"
|
81
|
-
expect(File.read("test.err")).not_to include "image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png is under a table but is not so labelled"
|
82
|
-
expect(File.read("test.err")).to include "image name spec/examples/rice_images/1000-1_ed2amd3fig2.png is under a table but is not so labelled"
|
83
|
-
expect(File.read("test.err")).to include "image name spec/examples/rice_images/1000-1_ed2amd3figTab2.png is labelled as under a table but is not"
|
84
|
-
expect(File.read("test.err")).not_to include "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is labelled as under a table but is not"
|
85
|
-
expect(File.read("test.err")).not_to include "image name spec/examples/rice_images/1000-1_ed2amd3figA2.png is under an annex but is not so labelled"
|
86
|
-
expect(File.read("test.err")).to include "image name spec/examples/rice_images/1000-1_ed2amd3fig3.png is under an annex but is not so labelled"
|
87
|
-
expect(File.read("test.err")).to include "image name spec/examples/rice_images/1000-1_ed2amd3figA1.png is labelled as under an annex but is not"
|
88
|
-
expect(File.read("test.err")).not_to include "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is labelled as under an annex but is not"
|
89
|
-
expect(File.read("test.err")).not_to include "image name spec/examples/rice_images/1000-1_ed2amd3fig1b.png has a subfigure letter but is not a subfigure"
|
90
|
-
expect(File.read("test.err")).to include "image name spec/examples/rice_images/1000-1_ed2amd3fig4.png does not have a subfigure letter but is a subfigure"
|
91
|
-
expect(File.read("test.err")).to include "image name spec/examples/rice_images/1000-1_ed2amd3fig1a.png has a subfigure letter but is not a subfigure"
|
92
|
-
expect(File.read("test.err")).not_to include "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png has a subfigure letter but is not a subfigure"
|
93
|
-
expect(File.read("test.err")).to include "image name spec/examples/rice_images/1000-1_ed2amd3fig5_f.png expected to have suffix _e"
|
94
|
-
expect(File.read("test.err")).not_to include "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png expected to have suffix _e"
|
95
|
-
end
|
96
128
|
|
97
|
-
|
98
|
-
|
99
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
100
|
-
= Document title
|
101
|
-
Author
|
102
|
-
:docfile: test.adoc
|
103
|
-
:nodoc:
|
104
|
-
:no-isobib:
|
105
|
-
:doctype: pizza
|
106
|
-
|
107
|
-
text
|
108
|
-
INPUT
|
109
|
-
expect(File.read("test.err")).to include "Scope clause missing"
|
110
|
-
|
111
|
-
FileUtils.rm_f "test.err"
|
112
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
113
|
-
= Document title
|
114
|
-
Author
|
115
|
-
:docfile: test.adoc
|
116
|
-
:nodoc:
|
117
|
-
:no-isobib:
|
118
|
-
:doctype: pizza
|
119
|
-
|
120
|
-
== Scope
|
121
|
-
INPUT
|
122
|
-
expect(File.read("test.err")).not_to include "Scope clause missing"
|
123
|
-
|
124
|
-
FileUtils.rm_f "test.err"
|
125
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
126
|
-
= Document title
|
127
|
-
Author
|
128
|
-
:docfile: test.adoc
|
129
|
-
:nodoc:
|
130
|
-
:no-isobib:
|
131
|
-
:doctype: amendment
|
132
|
-
|
133
|
-
text
|
134
|
-
INPUT
|
135
|
-
expect(File.read("test.err")).not_to include "Scope clause missing"
|
136
|
-
end
|
129
|
+
expect(File.read("test.err")).to include "Scope clause missing"
|
130
|
+
end
|
137
131
|
|
138
|
-
it "
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
:doctype: pizza
|
147
|
-
|
148
|
-
text
|
149
|
-
INPUT
|
150
|
-
expect(File.read("test.err")).to include "Normative references missing"
|
151
|
-
|
152
|
-
FileUtils.rm_f "test.err"
|
153
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
154
|
-
= Document title
|
155
|
-
Author
|
156
|
-
:docfile: test.adoc
|
157
|
-
:nodoc:
|
158
|
-
:no-isobib:
|
159
|
-
:doctype: pizza
|
160
|
-
|
161
|
-
[bibliography]
|
162
|
-
== Normative references
|
163
|
-
INPUT
|
164
|
-
expect(File.read("test.err")).not_to include "Normative references missing"
|
165
|
-
|
166
|
-
FileUtils.rm_f "test.err"
|
167
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
|
168
|
-
= Document title
|
169
|
-
Author
|
170
|
-
:docfile: test.adoc
|
171
|
-
:nodoc:
|
172
|
-
:no-isobib:
|
173
|
-
:doctype: amendment
|
174
|
-
|
175
|
-
text
|
176
|
-
INPUT
|
177
|
-
expect(File.read("test.err")).not_to include "Normative references missing"
|
132
|
+
it "Scope clause not missing 1" do
|
133
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
134
|
+
= Document title
|
135
|
+
Author
|
136
|
+
:docfile: test.adoc
|
137
|
+
:nodoc:
|
138
|
+
:no-isobib:
|
139
|
+
:doctype: pizza
|
178
140
|
|
179
|
-
|
141
|
+
== Scope
|
142
|
+
INPUT
|
143
|
+
expect(File.read("test.err")).not_to include "Scope clause missing"
|
144
|
+
end
|
180
145
|
|
181
|
-
it "
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
146
|
+
it "Scope clause not missing 2" do
|
147
|
+
FileUtils.rm_f "test.err"
|
148
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
149
|
+
= Document title
|
150
|
+
Author
|
151
|
+
:docfile: test.adoc
|
152
|
+
:nodoc:
|
153
|
+
:no-isobib:
|
154
|
+
:doctype: amendment
|
155
|
+
|
156
|
+
text
|
157
|
+
INPUT
|
158
|
+
expect(File.read("test.err")).not_to include "Scope clause missing"
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
context "Warns of missing normative references" do
|
163
|
+
it "Normative references missing" do
|
164
|
+
FileUtils.rm_f "test.err"
|
165
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
166
|
+
= Document title
|
167
|
+
Author
|
168
|
+
:docfile: test.adoc
|
169
|
+
:nodoc:
|
170
|
+
:no-isobib:
|
171
|
+
:doctype: pizza
|
172
|
+
|
173
|
+
text
|
174
|
+
INPUT
|
175
|
+
expect(File.read("test.err")).to include "Normative references missing"
|
176
|
+
end
|
177
|
+
|
178
|
+
it "Normative references not missing 1" do
|
179
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
180
|
+
= Document title
|
181
|
+
Author
|
182
|
+
:docfile: test.adoc
|
183
|
+
:nodoc:
|
184
|
+
:no-isobib:
|
185
|
+
:doctype: pizza
|
186
|
+
|
187
|
+
[bibliography]
|
188
|
+
== Normative references
|
189
|
+
INPUT
|
190
|
+
expect(File.read("test.err")).not_to include "Normative references missing"
|
191
|
+
end
|
192
|
+
|
193
|
+
it "Normative references not missing 2" do
|
194
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
195
|
+
= Document title
|
196
|
+
Author
|
197
|
+
:docfile: test.adoc
|
198
|
+
:nodoc:
|
199
|
+
:no-isobib:
|
200
|
+
:doctype: amendment
|
201
|
+
|
202
|
+
text
|
203
|
+
INPUT
|
204
|
+
expect(File.read("test.err")).not_to include "Normative references missing"
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
context "Warns of missing terms & definitions" do
|
209
|
+
it "Terms & definitions missing" do
|
210
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
211
|
+
= Document title
|
212
|
+
Author
|
213
|
+
:docfile: test.adoc
|
214
|
+
:nodoc:
|
215
|
+
:no-isobib:
|
216
|
+
:doctype: pizza
|
217
|
+
|
218
|
+
text
|
219
|
+
INPUT
|
220
|
+
expect(File.read("test.err")).to include "Terms & definitions missing"
|
221
|
+
end
|
222
|
+
|
223
|
+
it "Terms & definitions not missing 1" do
|
224
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
225
|
+
= Document title
|
226
|
+
Author
|
227
|
+
:docfile: test.adoc
|
228
|
+
:nodoc:
|
229
|
+
:no-isobib:
|
230
|
+
:doctype: pizza
|
231
|
+
|
232
|
+
== Terms and definitions
|
233
|
+
=== Term 1
|
234
|
+
INPUT
|
235
|
+
expect(File.read("test.err")).not_to include "Terms & definitions missing"
|
236
|
+
end
|
222
237
|
|
223
|
-
it "
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
238
|
+
it "Terms & definitions not missing 2" do
|
239
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
240
|
+
= Document title
|
241
|
+
Author
|
242
|
+
:docfile: test.adoc
|
243
|
+
:nodoc:
|
244
|
+
:no-isobib:
|
245
|
+
:doctype: amendment
|
246
|
+
|
247
|
+
text
|
248
|
+
INPUT
|
249
|
+
expect(File.read("test.err")).not_to include "Terms & definitions missing"
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
it "Warns of illegal doctype" do
|
254
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
255
|
+
= Document title
|
256
|
+
Author
|
257
|
+
:docfile: test.adoc
|
258
|
+
:nodoc:
|
259
|
+
:no-isobib:
|
260
|
+
:doctype: pizza
|
261
|
+
|
262
|
+
text
|
263
|
+
INPUT
|
235
264
|
expect(File.read("test.err")).to include "pizza is not a recognised document type"
|
236
|
-
end
|
265
|
+
end
|
266
|
+
|
267
|
+
it "Warns of illegal script" do
|
268
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
269
|
+
= Document title
|
270
|
+
Author
|
271
|
+
:docfile: test.adoc
|
272
|
+
:nodoc:
|
273
|
+
:no-isobib:
|
274
|
+
:script: pizza
|
237
275
|
|
238
|
-
|
239
|
-
|
240
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
241
|
-
= Document title
|
242
|
-
Author
|
243
|
-
:docfile: test.adoc
|
244
|
-
:nodoc:
|
245
|
-
:no-isobib:
|
246
|
-
:script: pizza
|
247
|
-
|
248
|
-
text
|
249
|
-
INPUT
|
276
|
+
text
|
277
|
+
INPUT
|
250
278
|
expect(File.read("test.err")).to include "pizza is not a recognised script"
|
251
|
-
end
|
279
|
+
end
|
252
280
|
|
253
|
-
it "Warns of illegal stage" do
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
INPUT
|
281
|
+
it "Warns of illegal stage" do
|
282
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
283
|
+
= Document title
|
284
|
+
Author
|
285
|
+
:docfile: test.adoc
|
286
|
+
:nodoc:
|
287
|
+
:no-isobib:
|
288
|
+
:status: pizza
|
289
|
+
|
290
|
+
text
|
291
|
+
INPUT
|
265
292
|
expect(File.read("test.err")).to include "pizza is not a recognised stage"
|
266
|
-
end
|
293
|
+
end
|
267
294
|
|
268
|
-
it "Warns of illegal substage" do
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
INPUT
|
295
|
+
it "Warns of illegal substage" do
|
296
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
297
|
+
= Document title
|
298
|
+
Author
|
299
|
+
:docfile: test.adoc
|
300
|
+
:nodoc:
|
301
|
+
:no-isobib:
|
302
|
+
:status: 60
|
303
|
+
:docsubstage: pizza
|
304
|
+
|
305
|
+
text
|
306
|
+
INPUT
|
281
307
|
expect(File.read("test.err")).to include "pizza is not a recognised substage"
|
282
|
-
end
|
308
|
+
end
|
309
|
+
|
310
|
+
it "Warns of illegal iteration" do
|
311
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
312
|
+
= Document title
|
313
|
+
Author
|
314
|
+
:docfile: test.adoc
|
315
|
+
:nodoc:
|
316
|
+
:no-isobib:
|
317
|
+
:status: 60
|
318
|
+
:iteration: pizza
|
283
319
|
|
284
|
-
|
285
|
-
|
286
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
287
|
-
= Document title
|
288
|
-
Author
|
289
|
-
:docfile: test.adoc
|
290
|
-
:nodoc:
|
291
|
-
:no-isobib:
|
292
|
-
:status: 60
|
293
|
-
:iteration: pizza
|
294
|
-
|
295
|
-
text
|
296
|
-
INPUT
|
320
|
+
text
|
321
|
+
INPUT
|
297
322
|
expect(File.read("test.err")).to include "pizza is not a recognised iteration"
|
298
|
-
end
|
323
|
+
end
|
324
|
+
|
325
|
+
it "Warns of illegal script" do
|
326
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
327
|
+
= Document title
|
328
|
+
Author
|
329
|
+
:docfile: test.adoc
|
330
|
+
:nodoc:
|
331
|
+
:no-isobib:
|
332
|
+
:script: pizza
|
299
333
|
|
300
|
-
|
301
|
-
|
302
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
303
|
-
= Document title
|
304
|
-
Author
|
305
|
-
:docfile: test.adoc
|
306
|
-
:nodoc:
|
307
|
-
:no-isobib:
|
308
|
-
:script: pizza
|
309
|
-
|
310
|
-
text
|
311
|
-
INPUT
|
334
|
+
text
|
335
|
+
INPUT
|
312
336
|
expect(File.read("test.err")).to include "pizza is not a recognised script"
|
313
|
-
end
|
337
|
+
end
|
314
338
|
|
315
|
-
it "warns that technical report may contain requirement" do
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
:doctype: technical-report
|
339
|
+
it "warns that technical report may contain requirement" do
|
340
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
341
|
+
= Document title
|
342
|
+
Author
|
343
|
+
:docfile: test.adoc
|
344
|
+
:nodoc:
|
345
|
+
:no-isobib:
|
346
|
+
:doctype: technical-report
|
324
347
|
|
325
|
-
|
348
|
+
== Random clause
|
326
349
|
|
327
|
-
|
328
|
-
|
350
|
+
The widget is required not to be larger than 15 cm.
|
351
|
+
INPUT
|
329
352
|
expect(File.read("test.err")).to include "Technical Report clause may contain requirement"
|
330
|
-
end
|
331
|
-
|
353
|
+
end
|
332
354
|
|
333
|
-
it "warns that introduction may contain requirement" do
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
== Introduction
|
355
|
+
it "warns that introduction may contain requirement" do
|
356
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
357
|
+
#{VALIDATING_BLANK_HDR}
|
358
|
+
== Introduction
|
338
359
|
|
339
|
-
|
340
|
-
|
360
|
+
The widget is required not to be larger than 15 cm.
|
361
|
+
INPUT
|
341
362
|
expect(File.read("test.err")).to include "Introduction may contain requirement"
|
342
|
-
end
|
363
|
+
end
|
343
364
|
|
344
|
-
it "warns that foreword may contain recommendation" do
|
345
|
-
|
346
|
-
|
347
|
-
#{VALIDATING_BLANK_HDR}
|
365
|
+
it "warns that foreword may contain recommendation" do
|
366
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
367
|
+
#{VALIDATING_BLANK_HDR}
|
348
368
|
|
349
|
-
|
369
|
+
It is not recommended that widgets should be larger than 15 cm.
|
350
370
|
|
351
|
-
|
352
|
-
|
371
|
+
== Clause
|
372
|
+
INPUT
|
353
373
|
expect(File.read("test.err")).to include "Foreword may contain recommendation"
|
354
|
-
end
|
374
|
+
end
|
355
375
|
|
356
|
-
it "warns that foreword may contain permission" do
|
357
|
-
|
358
|
-
|
359
|
-
#{VALIDATING_BLANK_HDR}
|
376
|
+
it "warns that foreword may contain permission" do
|
377
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
378
|
+
#{VALIDATING_BLANK_HDR}
|
360
379
|
|
361
|
-
|
380
|
+
No widget is required to be larger than 15 cm.
|
362
381
|
|
363
|
-
|
364
|
-
|
382
|
+
== Clause
|
383
|
+
INPUT
|
365
384
|
expect(File.read("test.err")).to include "Foreword may contain permission"
|
366
|
-
end
|
385
|
+
end
|
367
386
|
|
368
|
-
it "warns that scope may contain recommendation" do
|
369
|
-
|
370
|
-
|
371
|
-
#{VALIDATING_BLANK_HDR}
|
387
|
+
it "warns that scope may contain recommendation" do
|
388
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
389
|
+
#{VALIDATING_BLANK_HDR}
|
372
390
|
|
373
|
-
|
374
|
-
|
375
|
-
|
391
|
+
== Scope
|
392
|
+
It is not recommended that widgets should be larger than 15 cm.
|
393
|
+
INPUT
|
376
394
|
expect(File.read("test.err")).to include "Scope may contain recommendation"
|
377
|
-
end
|
395
|
+
end
|
378
396
|
|
379
|
-
it "warns that definition may contain requirement" do
|
380
|
-
|
381
|
-
|
382
|
-
#{VALIDATING_BLANK_HDR}
|
397
|
+
it "warns that definition may contain requirement" do
|
398
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
399
|
+
#{VALIDATING_BLANK_HDR}
|
383
400
|
|
384
|
-
|
401
|
+
== Terms and Definitions
|
385
402
|
|
386
|
-
|
403
|
+
=== Term1
|
387
404
|
|
388
|
-
|
405
|
+
It is required that there is a definition.
|
389
406
|
|
390
|
-
|
407
|
+
INPUT
|
391
408
|
expect(File.read("test.err")).to include "Definition may contain requirement"
|
392
|
-
end
|
409
|
+
end
|
393
410
|
|
394
|
-
it "warns that term example may contain recommendation" do
|
395
|
-
|
396
|
-
|
397
|
-
#{VALIDATING_BLANK_HDR}
|
411
|
+
it "warns that term example may contain recommendation" do
|
412
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
413
|
+
#{VALIDATING_BLANK_HDR}
|
398
414
|
|
399
|
-
|
415
|
+
== Terms and Definitions
|
400
416
|
|
401
|
-
|
417
|
+
=== Term
|
402
418
|
|
403
|
-
|
404
|
-
|
405
|
-
|
419
|
+
[example]
|
420
|
+
It is not recommended that widgets should be larger than 15 cm.
|
421
|
+
INPUT
|
406
422
|
expect(File.read("test.err")).to include "Example may contain recommendation"
|
407
|
-
end
|
423
|
+
end
|
408
424
|
|
409
|
-
it "warns that note may contain recommendation" do
|
410
|
-
|
411
|
-
|
412
|
-
#{VALIDATING_BLANK_HDR}
|
425
|
+
it "warns that note may contain recommendation" do
|
426
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
427
|
+
#{VALIDATING_BLANK_HDR}
|
413
428
|
|
414
|
-
|
415
|
-
|
429
|
+
NOTE: It is not recommended that widgets should be larger than 15 cm.
|
430
|
+
INPUT
|
416
431
|
expect(File.read("test.err")).to include "Note may contain recommendation"
|
417
|
-
end
|
432
|
+
end
|
418
433
|
|
419
|
-
it "warns that footnote may contain recommendation" do
|
420
|
-
|
421
|
-
|
422
|
-
#{VALIDATING_BLANK_HDR}
|
434
|
+
it "warns that footnote may contain recommendation" do
|
435
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
436
|
+
#{VALIDATING_BLANK_HDR}
|
423
437
|
|
424
|
-
|
425
|
-
|
438
|
+
footnote:[It is not recommended that widgets should be larger than 15 cm.]
|
439
|
+
INPUT
|
426
440
|
expect(File.read("test.err")).to include "Footnote may contain recommendation"
|
427
|
-
end
|
441
|
+
end
|
428
442
|
|
429
|
-
it "warns that term source is not in expected format" do
|
430
|
-
|
431
|
-
|
432
|
-
#{VALIDATING_BLANK_HDR}
|
443
|
+
it "warns that term source is not in expected format" do
|
444
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
445
|
+
#{VALIDATING_BLANK_HDR}
|
433
446
|
|
434
|
-
|
435
|
-
|
436
|
-
|
447
|
+
[.source]
|
448
|
+
I am a generic paragraph
|
449
|
+
INPUT
|
437
450
|
expect(File.read("test.err")).to include "term reference not in expected format"
|
438
|
-
end
|
451
|
+
end
|
439
452
|
|
440
|
-
it "warns that figure does not have title" do
|
441
|
-
|
442
|
-
|
443
|
-
#{VALIDATING_BLANK_HDR}
|
453
|
+
it "warns that figure does not have title" do
|
454
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
455
|
+
#{VALIDATING_BLANK_HDR}
|
444
456
|
|
445
|
-
|
446
|
-
|
457
|
+
image::spec/examples/rice_images/rice_image1.png[]
|
458
|
+
INPUT
|
447
459
|
expect(File.read("test.err")).to include "Figure should have title"
|
448
|
-
end
|
460
|
+
end
|
449
461
|
|
450
|
-
it "warns that callouts do not match annotations" do
|
451
|
-
|
452
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
462
|
+
it "warns that callouts do not match annotations" do
|
463
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
453
464
|
#{VALIDATING_BLANK_HDR}
|
454
465
|
[source,ruby]
|
455
466
|
--
|
@@ -460,1162 +471,1085 @@ it "warns that callouts do not match annotations" do
|
|
460
471
|
--
|
461
472
|
<1> This is one callout
|
462
473
|
<2> This is another callout
|
463
|
-
|
474
|
+
INPUT
|
464
475
|
expect(File.read("test.err")).to include "mismatch of callouts and annotations"
|
465
|
-
end
|
476
|
+
end
|
466
477
|
|
467
|
-
it "warns that term source is not a real reference" do
|
468
|
-
|
469
|
-
|
470
|
-
#{VALIDATING_BLANK_HDR}
|
478
|
+
it "warns that term source is not a real reference" do
|
479
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
480
|
+
#{VALIDATING_BLANK_HDR}
|
471
481
|
|
472
|
-
|
473
|
-
|
474
|
-
|
482
|
+
[.source]
|
483
|
+
<<iso123>>
|
484
|
+
INPUT
|
475
485
|
expect(File.read("test.err")).to include "iso123 does not have a corresponding anchor ID in the bibliography"
|
476
|
-
end
|
486
|
+
end
|
477
487
|
|
478
|
-
it "warns that undated reference has locality" do
|
479
|
-
|
480
|
-
|
481
|
-
#{VALIDATING_BLANK_HDR}
|
488
|
+
it "warns that undated reference has locality" do
|
489
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
490
|
+
#{VALIDATING_BLANK_HDR}
|
482
491
|
|
483
|
-
|
484
|
-
|
492
|
+
== Scope
|
493
|
+
<<iso123,clause=1>>
|
485
494
|
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
495
|
+
[bibliography]
|
496
|
+
== Normative References
|
497
|
+
* [[[iso123,ISO 123]]] _Standard_
|
498
|
+
INPUT
|
490
499
|
expect(File.read("test.err")).to include "undated reference ISO 123 should not contain specific elements"
|
491
|
-
end
|
500
|
+
end
|
492
501
|
|
493
|
-
it "do not warn that undated reference which is a bibliographic reference has locality" do
|
494
|
-
|
495
|
-
|
496
|
-
#{VALIDATING_BLANK_HDR}
|
502
|
+
it "do not warn that undated reference which is a bibliographic reference has locality" do
|
503
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
504
|
+
#{VALIDATING_BLANK_HDR}
|
497
505
|
|
498
|
-
|
499
|
-
|
506
|
+
== Scope
|
507
|
+
<<iso123,clause=1>>
|
500
508
|
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
509
|
+
[bibliography]
|
510
|
+
== Bibliography
|
511
|
+
* [[[iso123,1]]] _Standard_
|
512
|
+
INPUT
|
505
513
|
expect(File.read("test.err")).not_to include "undated reference [1] should not contain specific elements"
|
506
|
-
end
|
514
|
+
end
|
507
515
|
|
508
|
-
it "do not warn that undated IEV reference has locality" do
|
509
|
-
|
510
|
-
|
511
|
-
#{VALIDATING_BLANK_HDR}
|
516
|
+
it "do not warn that undated IEV reference has locality" do
|
517
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
518
|
+
#{VALIDATING_BLANK_HDR}
|
512
519
|
|
513
|
-
|
514
|
-
|
520
|
+
== Scope
|
521
|
+
<<iev,clause=1>>
|
515
522
|
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
523
|
+
[bibliography]
|
524
|
+
== Normative References
|
525
|
+
* [[[iev,IEV]]] _Standard_
|
526
|
+
INPUT
|
520
527
|
expect(File.read("test.err")).not_to include "undated reference IEV should not contain specific elements"
|
521
|
-
end
|
528
|
+
end
|
522
529
|
|
523
|
-
it "do not warn that in print has locality" do
|
524
|
-
|
525
|
-
|
526
|
-
#{VALIDATING_BLANK_HDR}
|
530
|
+
it "do not warn that in print has locality" do
|
531
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
532
|
+
#{VALIDATING_BLANK_HDR}
|
527
533
|
|
528
|
-
|
529
|
-
|
534
|
+
== Scope
|
535
|
+
<<iev,clause=1>>
|
530
536
|
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
537
|
+
[bibliography]
|
538
|
+
== Normative References
|
539
|
+
* [[[iev,ISO 123:--]]] _Standard_
|
540
|
+
INPUT
|
535
541
|
expect(File.read("test.err")).not_to include "undated reference ISO 123 should not contain specific elements"
|
536
|
-
end
|
542
|
+
end
|
537
543
|
|
538
|
-
it "warns of Non-reference in bibliography" do
|
539
|
-
|
540
|
-
|
541
|
-
#{VALIDATING_BLANK_HDR}
|
544
|
+
it "warns of Non-reference in bibliography" do
|
545
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
546
|
+
#{VALIDATING_BLANK_HDR}
|
542
547
|
|
543
|
-
|
544
|
-
|
545
|
-
|
548
|
+
== Normative References
|
549
|
+
* I am not a reference
|
550
|
+
INPUT
|
546
551
|
expect(File.read("test.err")).to include "no anchor on reference"
|
547
|
-
end
|
552
|
+
end
|
548
553
|
|
549
|
-
it "warns of Non-ISO reference in Normative References" do
|
550
|
-
|
551
|
-
|
552
|
-
#{VALIDATING_BLANK_HDR}
|
554
|
+
it "warns of Non-ISO reference in Normative References" do
|
555
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
556
|
+
#{VALIDATING_BLANK_HDR}
|
553
557
|
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
+
[bibliography]
|
559
|
+
== Normative References
|
560
|
+
* [[[XYZ,IESO 121]]] _Standard_
|
561
|
+
INPUT
|
558
562
|
expect(File.read("test.err")).to include "non-ISO/IEC reference not expected as normative"
|
559
|
-
end
|
563
|
+
end
|
560
564
|
|
561
|
-
it "warns that Scope contains subclauses" do
|
562
|
-
|
563
|
-
|
564
|
-
#{VALIDATING_BLANK_HDR}
|
565
|
+
it "warns that Scope contains subclauses" do
|
566
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
567
|
+
#{VALIDATING_BLANK_HDR}
|
565
568
|
|
566
|
-
|
569
|
+
== Scope
|
567
570
|
|
568
|
-
|
569
|
-
|
571
|
+
=== Scope subclause
|
572
|
+
INPUT
|
570
573
|
expect(File.read("test.err")).to include "Scope contains subclauses: should be succinct"
|
571
|
-
end
|
572
|
-
|
574
|
+
end
|
573
575
|
|
574
|
-
it "warns that Table should have title" do
|
575
|
-
|
576
|
-
|
577
|
-
#{VALIDATING_BLANK_HDR}
|
576
|
+
it "warns that Table should have title" do
|
577
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
578
|
+
#{VALIDATING_BLANK_HDR}
|
578
579
|
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
580
|
+
|===
|
581
|
+
|a |b |c
|
582
|
+
|===
|
583
|
+
INPUT
|
583
584
|
expect(File.read("test.err")).to include "Table should have title"
|
584
|
-
end
|
585
|
+
end
|
585
586
|
|
586
|
-
it "gives Style warning if number not broken up in threes" do
|
587
|
-
|
588
|
-
|
589
|
-
#{VALIDATING_BLANK_HDR}
|
587
|
+
it "gives Style warning if number not broken up in threes" do
|
588
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
589
|
+
#{VALIDATING_BLANK_HDR}
|
590
590
|
|
591
|
-
|
592
|
-
|
593
|
-
|
591
|
+
== Clause
|
592
|
+
12121
|
593
|
+
INPUT
|
594
594
|
expect(File.read("test.err")).to include "number not broken up in threes"
|
595
|
-
end
|
595
|
+
end
|
596
596
|
|
597
|
-
it "gives No style warning if number not broken up in threes is ISO reference" do
|
598
|
-
|
599
|
-
|
600
|
-
#{VALIDATING_BLANK_HDR}
|
597
|
+
it "gives No style warning if number not broken up in threes is ISO reference" do
|
598
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
599
|
+
#{VALIDATING_BLANK_HDR}
|
601
600
|
|
602
|
-
|
603
|
-
|
604
|
-
|
601
|
+
== Clause
|
602
|
+
ISO 12121
|
603
|
+
INPUT
|
605
604
|
expect(File.read("test.err")).not_to include "number not broken up in threes"
|
606
|
-
end
|
605
|
+
end
|
607
606
|
|
608
|
-
it "Style warning if decimal point" do
|
609
|
-
|
610
|
-
|
611
|
-
#{VALIDATING_BLANK_HDR}
|
607
|
+
it "Style warning if decimal point" do
|
608
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
609
|
+
#{VALIDATING_BLANK_HDR}
|
612
610
|
|
613
|
-
|
614
|
-
|
615
|
-
|
611
|
+
== Clause
|
612
|
+
8.1
|
613
|
+
INPUT
|
616
614
|
expect(File.read("test.err")).to include "possible decimal point"
|
617
|
-
end
|
615
|
+
end
|
618
616
|
|
619
|
-
it "Style warning if billion used" do
|
620
|
-
|
621
|
-
|
622
|
-
#{VALIDATING_BLANK_HDR}
|
617
|
+
it "Style warning if billion used" do
|
618
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
619
|
+
#{VALIDATING_BLANK_HDR}
|
623
620
|
|
624
|
-
|
625
|
-
|
626
|
-
|
621
|
+
== Clause
|
622
|
+
"Billions" are a term of art.
|
623
|
+
INPUT
|
627
624
|
expect(File.read("test.err")).to include "ambiguous number"
|
628
|
-
end
|
625
|
+
end
|
629
626
|
|
630
|
-
it "Style warning if no space before percent sign" do
|
631
|
-
|
632
|
-
|
633
|
-
#{VALIDATING_BLANK_HDR}
|
627
|
+
it "Style warning if no space before percent sign" do
|
628
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
629
|
+
#{VALIDATING_BLANK_HDR}
|
634
630
|
|
635
|
-
|
636
|
-
|
637
|
-
|
631
|
+
== Clause
|
632
|
+
95%
|
633
|
+
INPUT
|
638
634
|
expect(File.read("test.err")).to include "no space before percent sign"
|
639
|
-
end
|
635
|
+
end
|
640
636
|
|
641
|
-
it "Style warning if unbracketed tolerance before percent sign" do
|
642
|
-
|
643
|
-
|
644
|
-
#{VALIDATING_BLANK_HDR}
|
637
|
+
it "Style warning if unbracketed tolerance before percent sign" do
|
638
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
639
|
+
#{VALIDATING_BLANK_HDR}
|
645
640
|
|
646
|
-
|
647
|
-
|
648
|
-
|
641
|
+
== Clause
|
642
|
+
95 ± 5 %
|
643
|
+
INPUT
|
649
644
|
expect(File.read("test.err")).to include "unbracketed tolerance before percent sign"
|
650
|
-
end
|
645
|
+
end
|
651
646
|
|
652
|
-
it "Style warning if dots in abbreviation" do
|
653
|
-
|
654
|
-
|
655
|
-
#{VALIDATING_BLANK_HDR}
|
647
|
+
it "Style warning if dots in abbreviation" do
|
648
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
649
|
+
#{VALIDATING_BLANK_HDR}
|
656
650
|
|
657
|
-
|
658
|
-
|
659
|
-
|
651
|
+
== Clause
|
652
|
+
r.p.m.
|
653
|
+
INPUT
|
660
654
|
expect(File.read("test.err")).to include "no dots in abbreviation"
|
661
|
-
end
|
655
|
+
end
|
662
656
|
|
663
|
-
it "No Style warning if dots in abbreviation are e.g." do
|
664
|
-
|
665
|
-
|
666
|
-
#{VALIDATING_BLANK_HDR}
|
657
|
+
it "No Style warning if dots in abbreviation are e.g." do
|
658
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
659
|
+
#{VALIDATING_BLANK_HDR}
|
667
660
|
|
668
|
-
|
669
|
-
|
670
|
-
|
661
|
+
== Clause
|
662
|
+
e.g. 5
|
663
|
+
INPUT
|
671
664
|
expect(File.read("test.err")).not_to include "no dots in abbreviation"
|
672
|
-
end
|
665
|
+
end
|
673
666
|
|
674
|
-
it "Style warning if ppm used" do
|
675
|
-
|
676
|
-
|
677
|
-
#{VALIDATING_BLANK_HDR}
|
667
|
+
it "Style warning if ppm used" do
|
668
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
669
|
+
#{VALIDATING_BLANK_HDR}
|
678
670
|
|
679
|
-
|
680
|
-
|
681
|
-
|
671
|
+
== Clause
|
672
|
+
5 ppm
|
673
|
+
INPUT
|
682
674
|
expect(File.read("test.err")).to include "language-specific abbreviation"
|
683
|
-
end
|
675
|
+
end
|
684
676
|
|
685
|
-
it "Style warning if space between number and degree" do
|
686
|
-
|
687
|
-
|
688
|
-
#{VALIDATING_BLANK_HDR}
|
677
|
+
it "Style warning if space between number and degree" do
|
678
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
679
|
+
#{VALIDATING_BLANK_HDR}
|
689
680
|
|
690
|
-
|
691
|
-
|
692
|
-
|
681
|
+
== Clause
|
682
|
+
5 °
|
683
|
+
INPUT
|
693
684
|
expect(File.read("test.err")).to include "space between number and degrees/minutes/seconds"
|
694
|
-
end
|
685
|
+
end
|
695
686
|
|
696
|
-
it "Style warning if no space between number and SI unit" do
|
697
|
-
|
698
|
-
|
699
|
-
#{VALIDATING_BLANK_HDR}
|
687
|
+
it "Style warning if no space between number and SI unit" do
|
688
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
689
|
+
#{VALIDATING_BLANK_HDR}
|
700
690
|
|
701
|
-
|
702
|
-
|
703
|
-
|
691
|
+
== Clause
|
692
|
+
A measurement of 5Bq was taken.
|
693
|
+
INPUT
|
704
694
|
expect(File.read("test.err")).to include "no space between number and SI unit"
|
705
|
-
end
|
695
|
+
end
|
706
696
|
|
707
|
-
it "Style warning if mins used" do
|
708
|
-
|
709
|
-
|
710
|
-
#{VALIDATING_BLANK_HDR}
|
697
|
+
it "Style warning if mins used" do
|
698
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
699
|
+
#{VALIDATING_BLANK_HDR}
|
711
700
|
|
712
|
-
|
713
|
-
|
714
|
-
|
701
|
+
== Clause
|
702
|
+
5 mins
|
703
|
+
INPUT
|
715
704
|
expect(File.read("test.err")).to include "non-standard unit"
|
716
|
-
end
|
705
|
+
end
|
717
706
|
|
718
|
-
# can't test: our asciidoc template won't allow this to be generated
|
719
|
-
# it "Style warning if foreword contains subclauses" do
|
720
|
-
# expect { Asciidoctor.convert(<<~"INPUT",
|
707
|
+
# can't test: our asciidoc template won't allow this to be generated
|
708
|
+
# it "Style warning if foreword contains subclauses" do
|
709
|
+
# expect { Asciidoctor.convert(<<~"INPUT", *OPTIONS) }
|
710
|
+
# .to output(%r{non-standard unit}).to_stderr
|
721
711
|
# #{VALIDATING_BLANK_HDR}
|
722
|
-
#
|
712
|
+
#
|
723
713
|
# INPUT
|
724
|
-
# end
|
725
|
-
|
726
|
-
# can't test: we strip out any such content from Normative references preemptively
|
727
|
-
#it "Style warning if Normative References contains subclauses" do
|
728
|
-
#expect { Asciidoctor.convert(<<~"INPUT",
|
729
|
-
|
730
|
-
#
|
731
|
-
#
|
714
|
+
# end
|
715
|
+
|
716
|
+
# can't test: we strip out any such content from Normative references preemptively
|
717
|
+
# it "Style warning if Normative References contains subclauses" do
|
718
|
+
# expect { Asciidoctor.convert(<<~"INPUT", *OPTIONS) }
|
719
|
+
# .to output(%r{normative references contains subclauses}).to_stderr
|
720
|
+
# #{VALIDATING_BLANK_HDR}
|
721
|
+
#
|
722
|
+
# [bibliography]
|
732
723
|
#== Normative References
|
733
724
|
#
|
734
725
|
#=== Subsection
|
735
|
-
#INPUT
|
736
|
-
#end
|
726
|
+
# INPUT
|
727
|
+
# end
|
737
728
|
|
738
|
-
it "Style warning if two Symbols and Abbreviated Terms sections" do
|
739
|
-
|
740
|
-
|
741
|
-
#{VALIDATING_BLANK_HDR}
|
729
|
+
it "Style warning if two Symbols and Abbreviated Terms sections" do
|
730
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
731
|
+
#{VALIDATING_BLANK_HDR}
|
742
732
|
|
743
|
-
|
733
|
+
== Terms and Abbreviations
|
744
734
|
|
745
|
-
|
735
|
+
=== Symbols and Abbreviated Terms
|
746
736
|
|
747
|
-
|
748
|
-
|
737
|
+
== Symbols and Abbreviated Terms
|
738
|
+
INPUT
|
749
739
|
expect(File.read("test.err")).to include "Only one Symbols and Abbreviated Terms section in the standard"
|
750
|
-
end
|
740
|
+
end
|
751
741
|
|
752
|
-
it "Style warning if Symbols and Abbreviated Terms contains extraneous matter" do
|
753
|
-
|
754
|
-
|
755
|
-
#{VALIDATING_BLANK_HDR}
|
742
|
+
it "Style warning if Symbols and Abbreviated Terms contains extraneous matter" do
|
743
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
744
|
+
#{VALIDATING_BLANK_HDR}
|
756
745
|
|
757
|
-
|
746
|
+
== Symbols and Abbreviated Terms
|
758
747
|
|
759
|
-
|
760
|
-
|
748
|
+
Paragraph
|
749
|
+
INPUT
|
761
750
|
expect(File.read("test.err")).to include "Symbols and Abbreviated Terms can only contain a definition list"
|
762
|
-
end
|
751
|
+
end
|
763
752
|
|
764
|
-
it "Warning if missing foreword" do
|
765
|
-
|
766
|
-
|
767
|
-
#{VALIDATING_BLANK_HDR}
|
753
|
+
it "Warning if missing foreword" do
|
754
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
755
|
+
#{VALIDATING_BLANK_HDR}
|
768
756
|
|
769
|
-
|
757
|
+
== Symbols and Abbreviated Terms
|
770
758
|
|
771
|
-
|
772
|
-
|
759
|
+
Paragraph
|
760
|
+
INPUT
|
773
761
|
expect(File.read("test.err")).to include "Initial section must be (content) Foreword"
|
774
762
|
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
:doctype: amendment
|
763
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
764
|
+
= Document title
|
765
|
+
Author
|
766
|
+
:docfile: test.adoc
|
767
|
+
:nodoc:
|
768
|
+
:no-isobib:
|
769
|
+
:doctype: amendment
|
783
770
|
|
784
|
-
|
771
|
+
== Symbols and Abbreviated Terms
|
785
772
|
|
786
|
-
|
787
|
-
|
773
|
+
Paragraph
|
774
|
+
INPUT
|
788
775
|
expect(File.read("test.err")).not_to include "Initial section must be (content) Foreword"
|
776
|
+
end
|
789
777
|
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
795
|
-
#{VALIDATING_BLANK_HDR}
|
796
|
-
Foreword
|
778
|
+
it "Warning if do not start with scope or introduction" do
|
779
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
780
|
+
#{VALIDATING_BLANK_HDR}
|
781
|
+
Foreword
|
797
782
|
|
798
|
-
|
783
|
+
== Symbols and Abbreviated Terms
|
799
784
|
|
800
|
-
|
801
|
-
|
785
|
+
Paragraph
|
786
|
+
INPUT
|
802
787
|
expect(File.read("test.err")).to include "Prefatory material must be followed by (clause) Scope"
|
803
788
|
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
:doctype: amendment
|
789
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
790
|
+
= Document title
|
791
|
+
Author
|
792
|
+
:docfile: test.adoc
|
793
|
+
:nodoc:
|
794
|
+
:no-isobib:
|
795
|
+
:doctype: amendment
|
812
796
|
|
813
|
-
|
797
|
+
Foreword
|
814
798
|
|
815
|
-
|
799
|
+
== Symbols and Abbreviated Terms
|
816
800
|
|
817
|
-
|
818
|
-
|
801
|
+
Paragraph
|
802
|
+
INPUT
|
819
803
|
expect(File.read("test.err")).not_to include "Prefatory material must be followed by (clause) Scope"
|
804
|
+
end
|
820
805
|
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
FileUtils.rm_f "test.err"
|
825
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
826
|
-
#{VALIDATING_BLANK_HDR}
|
806
|
+
it "Warning if introduction not followed by scope" do
|
807
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
808
|
+
#{VALIDATING_BLANK_HDR}
|
827
809
|
|
828
|
-
|
829
|
-
|
810
|
+
.Foreword
|
811
|
+
Foreword
|
830
812
|
|
831
|
-
|
813
|
+
== Introduction
|
832
814
|
|
833
|
-
|
815
|
+
== Symbols and Abbreviated Terms
|
834
816
|
|
835
|
-
|
836
|
-
|
817
|
+
Paragraph
|
818
|
+
INPUT
|
837
819
|
expect(File.read("test.err")).to include "Prefatory material must be followed by (clause) Scope"
|
838
820
|
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
:doctype: amendment
|
821
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
822
|
+
= Document title
|
823
|
+
Author
|
824
|
+
:docfile: test.adoc
|
825
|
+
:nodoc:
|
826
|
+
:no-isobib:
|
827
|
+
:doctype: amendment
|
847
828
|
|
848
|
-
|
849
|
-
|
829
|
+
.Foreword
|
830
|
+
Foreword
|
850
831
|
|
851
|
-
|
832
|
+
== Introduction
|
852
833
|
|
853
|
-
|
834
|
+
== Symbols and Abbreviated Terms
|
854
835
|
|
855
|
-
|
856
|
-
|
836
|
+
Paragraph
|
837
|
+
INPUT
|
857
838
|
expect(File.read("test.err")).not_to include "Prefatory material must be followed by (clause) Scope"
|
839
|
+
end
|
858
840
|
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
FileUtils.rm_f "test.err"
|
863
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
864
|
-
#{VALIDATING_BLANK_HDR}
|
841
|
+
it "Warning if normative references not followed by terms and definitions" do
|
842
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
843
|
+
#{VALIDATING_BLANK_HDR}
|
865
844
|
|
866
|
-
|
867
|
-
|
845
|
+
.Foreword
|
846
|
+
Foreword
|
868
847
|
|
869
|
-
|
848
|
+
== Scope
|
870
849
|
|
871
|
-
|
872
|
-
|
850
|
+
[bibliography]
|
851
|
+
== Normative References
|
873
852
|
|
874
|
-
|
853
|
+
== Symbols and Abbreviated Terms
|
875
854
|
|
876
|
-
|
877
|
-
|
855
|
+
Paragraph
|
856
|
+
INPUT
|
878
857
|
expect(File.read("test.err")).to include "Normative References must be followed by Terms and Definitions"
|
879
858
|
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
:doctype: amendment
|
859
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
860
|
+
= Document title
|
861
|
+
Author
|
862
|
+
:docfile: test.adoc
|
863
|
+
:nodoc:
|
864
|
+
:no-isobib:
|
865
|
+
:doctype: amendment
|
888
866
|
|
889
|
-
|
890
|
-
|
867
|
+
.Foreword
|
868
|
+
Foreword
|
891
869
|
|
892
|
-
|
870
|
+
== Scope
|
893
871
|
|
894
|
-
|
895
|
-
|
872
|
+
[bibliography]
|
873
|
+
== Normative References
|
896
874
|
|
897
|
-
|
875
|
+
== Symbols and Abbreviated Terms
|
898
876
|
|
899
|
-
|
900
|
-
|
877
|
+
Paragraph
|
878
|
+
INPUT
|
901
879
|
expect(File.read("test.err")).not_to include "Normative References must be followed by Terms and Definitions"
|
880
|
+
end
|
902
881
|
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
FileUtils.rm_f "test.err"
|
907
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
908
|
-
#{VALIDATING_BLANK_HDR}
|
882
|
+
it "Warning if there are no clauses in the document" do
|
883
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
884
|
+
#{VALIDATING_BLANK_HDR}
|
909
885
|
|
910
|
-
|
911
|
-
|
886
|
+
.Foreword
|
887
|
+
Foreword
|
912
888
|
|
913
|
-
|
889
|
+
== Scope
|
914
890
|
|
915
|
-
|
916
|
-
|
891
|
+
[bibliography]
|
892
|
+
== Normative References
|
917
893
|
|
918
|
-
|
894
|
+
== Terms and Definitions
|
919
895
|
|
920
|
-
|
896
|
+
== Symbols and Abbreviated Terms
|
921
897
|
|
922
|
-
|
898
|
+
INPUT
|
923
899
|
expect(File.read("test.err")).to include "Document must contain at least one clause"
|
924
900
|
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
:doctype: amendment
|
901
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
902
|
+
= Document title
|
903
|
+
Author
|
904
|
+
:docfile: test.adoc
|
905
|
+
:nodoc:
|
906
|
+
:no-isobib:
|
907
|
+
:doctype: amendment
|
933
908
|
|
934
|
-
|
935
|
-
|
909
|
+
.Foreword
|
910
|
+
Foreword
|
936
911
|
|
937
|
-
|
912
|
+
== Scope
|
938
913
|
|
939
|
-
|
940
|
-
|
914
|
+
[bibliography]
|
915
|
+
== Normative References
|
941
916
|
|
942
|
-
|
917
|
+
== Terms and Definitions
|
943
918
|
|
944
|
-
|
919
|
+
== Symbols and Abbreviated Terms
|
945
920
|
|
946
|
-
|
921
|
+
INPUT
|
947
922
|
expect(File.read("test.err")).not_to include "Document must contain at least one clause"
|
948
|
-
end
|
923
|
+
end
|
949
924
|
|
950
|
-
it "Warning if scope occurs after Terms and Definitions" do
|
951
|
-
|
952
|
-
|
953
|
-
#{VALIDATING_BLANK_HDR}
|
925
|
+
it "Warning if scope occurs after Terms and Definitions" do
|
926
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
927
|
+
#{VALIDATING_BLANK_HDR}
|
954
928
|
|
955
|
-
|
956
|
-
|
929
|
+
.Foreword
|
930
|
+
Foreword
|
957
931
|
|
958
|
-
|
932
|
+
== Scope
|
959
933
|
|
960
|
-
|
961
|
-
|
934
|
+
[bibliography]
|
935
|
+
== Normative References
|
962
936
|
|
963
|
-
|
937
|
+
== Terms and Definitions
|
964
938
|
|
965
|
-
|
939
|
+
== Clause
|
966
940
|
|
967
|
-
|
941
|
+
== Scope
|
968
942
|
|
969
|
-
|
943
|
+
INPUT
|
970
944
|
expect(File.read("test.err")).to include "Scope must occur before Terms and Definitions"
|
971
945
|
|
972
|
-
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
977
|
-
|
978
|
-
|
979
|
-
:doctype: amendment
|
946
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
947
|
+
= Document title
|
948
|
+
Author
|
949
|
+
:docfile: test.adoc
|
950
|
+
:nodoc:
|
951
|
+
:no-isobib:
|
952
|
+
:doctype: amendment
|
980
953
|
|
981
|
-
|
982
|
-
|
954
|
+
.Foreword
|
955
|
+
Foreword
|
983
956
|
|
984
|
-
|
957
|
+
== Scope
|
985
958
|
|
986
|
-
|
987
|
-
|
959
|
+
[bibliography]
|
960
|
+
== Normative References
|
988
961
|
|
989
|
-
|
962
|
+
== Terms and Definitions
|
990
963
|
|
991
|
-
|
964
|
+
== Clause
|
992
965
|
|
993
|
-
|
966
|
+
== Scope
|
994
967
|
|
995
|
-
|
968
|
+
INPUT
|
996
969
|
expect(File.read("test.err")).not_to include "Scope must occur before Terms and Definitions"
|
970
|
+
end
|
997
971
|
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
FileUtils.rm_f "test.err"
|
1002
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
1003
|
-
#{VALIDATING_BLANK_HDR}
|
972
|
+
it "Warning if Symbols and Abbreviated Terms does not occur immediately after Terms and Definitions" do
|
973
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
974
|
+
#{VALIDATING_BLANK_HDR}
|
1004
975
|
|
1005
|
-
|
1006
|
-
|
976
|
+
.Foreword
|
977
|
+
Foreword
|
1007
978
|
|
1008
|
-
|
979
|
+
== Scope
|
1009
980
|
|
1010
|
-
|
1011
|
-
|
981
|
+
[bibliography]
|
982
|
+
== Normative References
|
1012
983
|
|
1013
|
-
|
984
|
+
== Terms and Definitions
|
1014
985
|
|
1015
|
-
|
986
|
+
== Clause
|
1016
987
|
|
1017
|
-
|
988
|
+
== Symbols and Abbreviated Terms
|
1018
989
|
|
1019
|
-
|
990
|
+
INPUT
|
1020
991
|
expect(File.read("test.err")).to include "Only annexes and references can follow clauses"
|
1021
992
|
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
:doctype: amendment
|
993
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
994
|
+
= Document title
|
995
|
+
Author
|
996
|
+
:docfile: test.adoc
|
997
|
+
:nodoc:
|
998
|
+
:no-isobib:
|
999
|
+
:doctype: amendment
|
1030
1000
|
|
1031
1001
|
|
1032
|
-
|
1033
|
-
|
1002
|
+
.Foreword
|
1003
|
+
Foreword
|
1034
1004
|
|
1035
|
-
|
1005
|
+
== Scope
|
1036
1006
|
|
1037
|
-
|
1038
|
-
|
1007
|
+
[bibliography]
|
1008
|
+
== Normative References
|
1039
1009
|
|
1040
|
-
|
1010
|
+
== Terms and Definitions
|
1041
1011
|
|
1042
|
-
|
1012
|
+
== Clause
|
1043
1013
|
|
1044
|
-
|
1014
|
+
== Symbols and Abbreviated Terms
|
1045
1015
|
|
1046
|
-
|
1016
|
+
INPUT
|
1047
1017
|
expect(File.read("test.err")).not_to include "Only annexes and references can follow clauses"
|
1018
|
+
end
|
1048
1019
|
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
FileUtils.rm_f "test.err"
|
1053
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
1054
|
-
#{VALIDATING_BLANK_HDR}
|
1020
|
+
it "Warning if no normative references" do
|
1021
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1022
|
+
#{VALIDATING_BLANK_HDR}
|
1055
1023
|
|
1056
|
-
|
1057
|
-
|
1024
|
+
.Foreword
|
1025
|
+
Foreword
|
1058
1026
|
|
1059
|
-
|
1027
|
+
== Scope
|
1060
1028
|
|
1061
|
-
|
1029
|
+
== Terms and Definitions
|
1062
1030
|
|
1063
|
-
|
1031
|
+
== Clause
|
1064
1032
|
|
1065
|
-
|
1066
|
-
|
1033
|
+
[appendix]
|
1034
|
+
== Appendix A
|
1067
1035
|
|
1068
|
-
|
1069
|
-
|
1036
|
+
[appendix]
|
1037
|
+
== Appendix B
|
1070
1038
|
|
1071
|
-
|
1072
|
-
|
1039
|
+
[appendix]
|
1040
|
+
== Appendix C
|
1073
1041
|
|
1074
|
-
|
1042
|
+
INPUT
|
1075
1043
|
expect(File.read("test.err")).to include "Document must include (references) Normative References"
|
1076
1044
|
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
:doctype: amendment
|
1045
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1046
|
+
= Document title
|
1047
|
+
Author
|
1048
|
+
:docfile: test.adoc
|
1049
|
+
:nodoc:
|
1050
|
+
:no-isobib:
|
1051
|
+
:doctype: amendment
|
1085
1052
|
|
1086
|
-
|
1087
|
-
|
1053
|
+
.Foreword
|
1054
|
+
Foreword
|
1088
1055
|
|
1089
|
-
|
1056
|
+
== Scope
|
1090
1057
|
|
1091
|
-
|
1058
|
+
== Terms and Definitions
|
1092
1059
|
|
1093
|
-
|
1060
|
+
== Clause
|
1094
1061
|
|
1095
|
-
|
1096
|
-
|
1062
|
+
[appendix]
|
1063
|
+
== Appendix A
|
1097
1064
|
|
1098
|
-
|
1099
|
-
|
1065
|
+
[appendix]
|
1066
|
+
== Appendix B
|
1100
1067
|
|
1101
|
-
|
1102
|
-
|
1068
|
+
[appendix]
|
1069
|
+
== Appendix C
|
1103
1070
|
|
1104
|
-
|
1071
|
+
INPUT
|
1105
1072
|
expect(File.read("test.err")).not_to include "Document must include (references) Normative References"
|
1073
|
+
end
|
1106
1074
|
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
FileUtils.rm_f "test.err"
|
1111
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
1112
|
-
#{VALIDATING_BLANK_HDR}
|
1075
|
+
it "Warning if final section is not named Bibliography" do
|
1076
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1077
|
+
#{VALIDATING_BLANK_HDR}
|
1113
1078
|
|
1114
|
-
|
1115
|
-
|
1079
|
+
.Foreword
|
1080
|
+
Foreword
|
1116
1081
|
|
1117
|
-
|
1082
|
+
== Scope
|
1118
1083
|
|
1119
|
-
|
1120
|
-
|
1084
|
+
[bibliography]
|
1085
|
+
== Normative References
|
1121
1086
|
|
1122
|
-
|
1087
|
+
== Terms and Definitions
|
1123
1088
|
|
1124
|
-
|
1089
|
+
== Clause
|
1125
1090
|
|
1126
|
-
|
1127
|
-
|
1091
|
+
[appendix]
|
1092
|
+
== Appendix A
|
1128
1093
|
|
1129
|
-
|
1130
|
-
|
1094
|
+
[appendix]
|
1095
|
+
== Appendix B
|
1131
1096
|
|
1132
|
-
|
1133
|
-
|
1097
|
+
[bibliography]
|
1098
|
+
== Bibliography
|
1134
1099
|
|
1135
|
-
|
1136
|
-
|
1100
|
+
[bibliography]
|
1101
|
+
== Appendix C
|
1137
1102
|
|
1138
|
-
|
1103
|
+
INPUT
|
1139
1104
|
expect(File.read("test.err")).to include "There are sections after the final Bibliography"
|
1140
1105
|
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
:doctype: amendment
|
1106
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1107
|
+
= Document title
|
1108
|
+
Author
|
1109
|
+
:docfile: test.adoc
|
1110
|
+
:nodoc:
|
1111
|
+
:no-isobib:
|
1112
|
+
:doctype: amendment
|
1149
1113
|
|
1150
|
-
|
1151
|
-
|
1114
|
+
.Foreword
|
1115
|
+
Foreword
|
1152
1116
|
|
1153
|
-
|
1117
|
+
== Scope
|
1154
1118
|
|
1155
|
-
|
1156
|
-
|
1119
|
+
[bibliography]
|
1120
|
+
== Normative References
|
1157
1121
|
|
1158
|
-
|
1122
|
+
== Terms and Definitions
|
1159
1123
|
|
1160
|
-
|
1124
|
+
== Clause
|
1161
1125
|
|
1162
|
-
|
1163
|
-
|
1126
|
+
[appendix]
|
1127
|
+
== Appendix A
|
1164
1128
|
|
1165
|
-
|
1166
|
-
|
1129
|
+
[appendix]
|
1130
|
+
== Appendix B
|
1167
1131
|
|
1168
|
-
|
1169
|
-
|
1132
|
+
[bibliography]
|
1133
|
+
== Bibliography
|
1170
1134
|
|
1171
|
-
|
1172
|
-
|
1135
|
+
[bibliography]
|
1136
|
+
== Appendix C
|
1173
1137
|
|
1174
|
-
|
1138
|
+
INPUT
|
1175
1139
|
expect(File.read("test.err")).not_to include "There are sections after the final Bibliography"
|
1140
|
+
end
|
1176
1141
|
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
FileUtils.rm_f "test.err"
|
1181
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
1182
|
-
#{VALIDATING_BLANK_HDR}
|
1142
|
+
it "Warning if final section is not styled Bibliography" do
|
1143
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1144
|
+
#{VALIDATING_BLANK_HDR}
|
1183
1145
|
|
1184
|
-
|
1185
|
-
|
1146
|
+
.Foreword
|
1147
|
+
Foreword
|
1186
1148
|
|
1187
|
-
|
1149
|
+
== Scope
|
1188
1150
|
|
1189
|
-
|
1190
|
-
|
1151
|
+
[bibliography]
|
1152
|
+
== Normative References
|
1191
1153
|
|
1192
|
-
|
1154
|
+
== Terms and Definitions
|
1193
1155
|
|
1194
|
-
|
1156
|
+
== Clause
|
1195
1157
|
|
1196
|
-
|
1197
|
-
|
1158
|
+
[appendix]
|
1159
|
+
== Appendix A
|
1198
1160
|
|
1199
|
-
|
1200
|
-
|
1161
|
+
[appendix]
|
1162
|
+
== Appendix B
|
1201
1163
|
|
1202
|
-
|
1164
|
+
== Bibliography
|
1203
1165
|
|
1204
|
-
|
1166
|
+
INPUT
|
1205
1167
|
expect(File.read("test.err")).to include "Section not marked up as [bibliography]"
|
1168
|
+
end
|
1206
1169
|
|
1170
|
+
it "Warning if final section is not styled Bibliography false" do
|
1171
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1172
|
+
= Document title
|
1173
|
+
Author
|
1174
|
+
:docfile: test.adoc
|
1175
|
+
:nodoc:
|
1176
|
+
:no-isobib:
|
1177
|
+
:doctype: amendment
|
1207
1178
|
|
1208
|
-
|
1209
|
-
|
1210
|
-
= Document title
|
1211
|
-
Author
|
1212
|
-
:docfile: test.adoc
|
1213
|
-
:nodoc:
|
1214
|
-
:no-isobib:
|
1215
|
-
:doctype: amendment
|
1216
|
-
|
1217
|
-
.Foreword
|
1218
|
-
Foreword
|
1179
|
+
.Foreword
|
1180
|
+
Foreword
|
1219
1181
|
|
1220
|
-
|
1182
|
+
== Scope
|
1221
1183
|
|
1222
|
-
|
1223
|
-
|
1184
|
+
[bibliography]
|
1185
|
+
== Normative References
|
1224
1186
|
|
1225
|
-
|
1187
|
+
== Terms and Definitions
|
1226
1188
|
|
1227
|
-
|
1189
|
+
== Clause
|
1228
1190
|
|
1229
|
-
|
1230
|
-
|
1191
|
+
[appendix]
|
1192
|
+
== Appendix A
|
1231
1193
|
|
1232
|
-
|
1233
|
-
|
1194
|
+
[appendix]
|
1195
|
+
== Appendix B
|
1234
1196
|
|
1235
|
-
|
1197
|
+
== Bibliography
|
1236
1198
|
|
1237
|
-
|
1199
|
+
INPUT
|
1238
1200
|
expect(File.read("test.err")).not_to include "Section not marked up as [bibliography]"
|
1201
|
+
end
|
1239
1202
|
|
1240
|
-
|
1203
|
+
it "Warning if English title intro and no French title intro" do
|
1204
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1205
|
+
= Document title
|
1206
|
+
Author
|
1207
|
+
:docfile: test.adoc
|
1208
|
+
:nodoc:
|
1209
|
+
:title-intro-en: Title
|
1210
|
+
:no-isobib:
|
1241
1211
|
|
1242
|
-
|
1243
|
-
FileUtils.rm_f "test.err"
|
1244
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
1245
|
-
= Document title
|
1246
|
-
Author
|
1247
|
-
:docfile: test.adoc
|
1248
|
-
:nodoc:
|
1249
|
-
:title-intro-en: Title
|
1250
|
-
:no-isobib:
|
1251
|
-
|
1252
|
-
INPUT
|
1212
|
+
INPUT
|
1253
1213
|
expect(File.read("test.err")).to include "No French Title Intro"
|
1254
|
-
end
|
1214
|
+
end
|
1255
1215
|
|
1256
|
-
it "Warning if French title intro and no English title intro" do
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
1264
|
-
:no-isobib:
|
1265
|
-
|
1266
|
-
INPUT
|
1267
|
-
expect(File.read("test.err")).to include "No English Title Intro"
|
1268
|
-
end
|
1216
|
+
it "Warning if French title intro and no English title intro" do
|
1217
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1218
|
+
= Document title
|
1219
|
+
Author
|
1220
|
+
:docfile: test.adoc
|
1221
|
+
:nodoc:
|
1222
|
+
:title-intro-fr: Title
|
1223
|
+
:no-isobib:
|
1269
1224
|
|
1225
|
+
INPUT
|
1226
|
+
expect(File.read("test.err")).to include "No English Title Intro"
|
1227
|
+
end
|
1270
1228
|
|
1271
|
-
it "Warning if English title and no French intro" do
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
:no-isobib:
|
1229
|
+
it "Warning if English title and no French intro" do
|
1230
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1231
|
+
= Document title
|
1232
|
+
Author
|
1233
|
+
:docfile: test.adoc
|
1234
|
+
:nodoc:
|
1235
|
+
:title-main-en: Title
|
1236
|
+
:no-isobib:
|
1280
1237
|
|
1281
|
-
|
1238
|
+
INPUT
|
1282
1239
|
expect(File.read("test.err")).to include "No French Title"
|
1283
|
-
end
|
1240
|
+
end
|
1241
|
+
|
1242
|
+
it "Warning if French title and no English title" do
|
1243
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1244
|
+
= Document title
|
1245
|
+
Author
|
1246
|
+
:docfile: test.adoc
|
1247
|
+
:nodoc:
|
1248
|
+
:title-main-fr: Title
|
1249
|
+
:no-isobib:
|
1284
1250
|
|
1285
|
-
|
1286
|
-
FileUtils.rm_f "test.err"
|
1287
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
1288
|
-
= Document title
|
1289
|
-
Author
|
1290
|
-
:docfile: test.adoc
|
1291
|
-
:nodoc:
|
1292
|
-
:title-main-fr: Title
|
1293
|
-
:no-isobib:
|
1294
|
-
|
1295
|
-
INPUT
|
1251
|
+
INPUT
|
1296
1252
|
expect(File.read("test.err")).to include "No English Title"
|
1297
|
-
end
|
1253
|
+
end
|
1298
1254
|
|
1299
|
-
it "Warning if English title part and no French title part" do
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
|
1308
|
-
|
1309
|
-
INPUT
|
1255
|
+
it "Warning if English title part and no French title part" do
|
1256
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1257
|
+
= Document title
|
1258
|
+
Author
|
1259
|
+
:docfile: test.adoc
|
1260
|
+
:nodoc:
|
1261
|
+
:title-part-en: Title
|
1262
|
+
:no-isobib:
|
1263
|
+
|
1264
|
+
INPUT
|
1310
1265
|
expect(File.read("test.err")).to include "No French Title Part"
|
1311
|
-
end
|
1266
|
+
end
|
1312
1267
|
|
1313
|
-
it "Warning if French title part and no English title part" do
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
INPUT
|
1268
|
+
it "Warning if French title part and no English title part" do
|
1269
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1270
|
+
= Document title
|
1271
|
+
Author
|
1272
|
+
:docfile: test.adoc
|
1273
|
+
:nodoc:
|
1274
|
+
:title-part-fr: Title
|
1275
|
+
:no-isobib:
|
1276
|
+
|
1277
|
+
INPUT
|
1324
1278
|
expect(File.read("test.err")).to include "No English Title Part"
|
1325
|
-
end
|
1279
|
+
end
|
1326
1280
|
|
1327
|
-
it "Warning if non-IEC document with subpart" do
|
1328
|
-
|
1329
|
-
|
1330
|
-
|
1331
|
-
|
1332
|
-
|
1333
|
-
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1339
|
-
INPUT
|
1281
|
+
it "Warning if non-IEC document with subpart" do
|
1282
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1283
|
+
= Document title
|
1284
|
+
Author
|
1285
|
+
:docfile: test.adoc
|
1286
|
+
:nodoc:
|
1287
|
+
:docnumber: 10
|
1288
|
+
:partnumber: 1-1
|
1289
|
+
:publisher: ISO
|
1290
|
+
:no-isobib:
|
1291
|
+
|
1292
|
+
INPUT
|
1340
1293
|
expect(File.read("test.err")).to include "Subpart defined on non-IEC document"
|
1341
|
-
end
|
1294
|
+
end
|
1295
|
+
|
1296
|
+
it "No warning if joint IEC/non-IEC document with subpart" do
|
1297
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1298
|
+
= Document title
|
1299
|
+
Author
|
1300
|
+
:docfile: test.adoc
|
1301
|
+
:nodoc:
|
1302
|
+
:docnumber: 10
|
1303
|
+
:partnumber: 1-1
|
1304
|
+
:publisher: ISO;IEC
|
1305
|
+
:no-isobib:
|
1342
1306
|
|
1343
|
-
|
1344
|
-
FileUtils.rm_f "test.err"
|
1345
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
1346
|
-
= Document title
|
1347
|
-
Author
|
1348
|
-
:docfile: test.adoc
|
1349
|
-
:nodoc:
|
1350
|
-
:docnumber: 10
|
1351
|
-
:partnumber: 1-1
|
1352
|
-
:publisher: ISO;IEC
|
1353
|
-
:no-isobib:
|
1354
|
-
|
1355
|
-
INPUT
|
1307
|
+
INPUT
|
1356
1308
|
expect(File.read("test.err")).not_to include "Subpart defined on non-IEC document"
|
1357
|
-
end
|
1309
|
+
end
|
1310
|
+
|
1311
|
+
it "Warning if main title contains document type" do
|
1312
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1313
|
+
= Document title
|
1314
|
+
Author
|
1315
|
+
:docfile: test.adoc
|
1316
|
+
:nodoc:
|
1317
|
+
:title-main-en: A Technical Specification on Widgets
|
1318
|
+
:no-isobib:
|
1358
1319
|
|
1359
|
-
|
1360
|
-
FileUtils.rm_f "test.err"
|
1361
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
1362
|
-
= Document title
|
1363
|
-
Author
|
1364
|
-
:docfile: test.adoc
|
1365
|
-
:nodoc:
|
1366
|
-
:title-main-en: A Technical Specification on Widgets
|
1367
|
-
:no-isobib:
|
1368
|
-
|
1369
|
-
INPUT
|
1320
|
+
INPUT
|
1370
1321
|
expect(File.read("test.err")).to include "Main Title may name document type"
|
1371
|
-
end
|
1322
|
+
end
|
1372
1323
|
|
1373
|
-
it "Warning if intro title contains document type" do
|
1374
|
-
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
|
1379
|
-
|
1380
|
-
|
1381
|
-
|
1382
|
-
|
1383
|
-
INPUT
|
1324
|
+
it "Warning if intro title contains document type" do
|
1325
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1326
|
+
= Document title
|
1327
|
+
Author
|
1328
|
+
:docfile: test.adoc
|
1329
|
+
:nodoc:
|
1330
|
+
:title-intro-en: A Technical Specification on Widgets
|
1331
|
+
:no-isobib:
|
1332
|
+
|
1333
|
+
INPUT
|
1384
1334
|
expect(File.read("test.err")).to include "Title Intro may name document type"
|
1385
|
-
end
|
1335
|
+
end
|
1386
1336
|
|
1387
|
-
it "Each first-level subclause must have a title" do
|
1388
|
-
|
1389
|
-
|
1390
|
-
|
1391
|
-
== Clause
|
1337
|
+
it "Each first-level subclause must have a title" do
|
1338
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1339
|
+
#{VALIDATING_BLANK_HDR}
|
1340
|
+
== Clause
|
1392
1341
|
|
1393
|
-
|
1394
|
-
|
1342
|
+
=== {blank}
|
1343
|
+
INPUT
|
1395
1344
|
expect(File.read("test.err")).to include "each first-level subclause must have a title"
|
1396
|
-
end
|
1345
|
+
end
|
1397
1346
|
|
1398
|
-
it "All subclauses must have a title, or none" do
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
== Clause
|
1347
|
+
it "All subclauses must have a title, or none" do
|
1348
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1349
|
+
#{VALIDATING_BLANK_HDR}
|
1350
|
+
== Clause
|
1403
1351
|
|
1404
|
-
|
1352
|
+
=== Subclause
|
1405
1353
|
|
1406
|
-
|
1354
|
+
==== {blank}
|
1407
1355
|
|
1408
|
-
|
1409
|
-
|
1356
|
+
==== Subsubclause
|
1357
|
+
INPUT
|
1410
1358
|
expect(File.read("test.err")).to include "all subclauses must have a title, or none"
|
1411
|
-
end
|
1359
|
+
end
|
1412
1360
|
|
1413
|
-
it "Warning if subclause is only child of its parent, or none" do
|
1414
|
-
|
1415
|
-
|
1416
|
-
|
1417
|
-
== Clause
|
1361
|
+
it "Warning if subclause is only child of its parent, or none" do
|
1362
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1363
|
+
#{VALIDATING_BLANK_HDR}
|
1364
|
+
== Clause
|
1418
1365
|
|
1419
|
-
|
1366
|
+
=== Subclause
|
1420
1367
|
|
1421
|
-
|
1368
|
+
INPUT
|
1422
1369
|
expect(File.read("test.err")).to include "subclause is only child"
|
1423
|
-
end
|
1370
|
+
end
|
1424
1371
|
|
1425
|
-
it "Warning if invalid technical committee type" do
|
1426
|
-
|
1427
|
-
|
1428
|
-
|
1429
|
-
|
1430
|
-
|
1431
|
-
|
1432
|
-
|
1433
|
-
|
1434
|
-
|
1435
|
-
INPUT
|
1372
|
+
it "Warning if invalid technical committee type" do
|
1373
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1374
|
+
= Document title
|
1375
|
+
Author
|
1376
|
+
:docfile: test.adoc
|
1377
|
+
:nodoc:
|
1378
|
+
:technical-committee-type: X
|
1379
|
+
:no-isobib:
|
1380
|
+
|
1381
|
+
INPUT
|
1436
1382
|
expect(File.read("test.err")).to include "invalid technical committee type"
|
1437
|
-
end
|
1383
|
+
end
|
1438
1384
|
|
1439
|
-
it "Warning if invalid subcommittee type" do
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1443
|
-
|
1444
|
-
|
1445
|
-
|
1446
|
-
|
1447
|
-
|
1448
|
-
|
1449
|
-
INPUT
|
1385
|
+
it "Warning if invalid subcommittee type" do
|
1386
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1387
|
+
= Document title
|
1388
|
+
Author
|
1389
|
+
:docfile: test.adoc
|
1390
|
+
:nodoc:
|
1391
|
+
:subcommittee-type: X
|
1392
|
+
:no-isobib:
|
1393
|
+
|
1394
|
+
INPUT
|
1450
1395
|
expect(File.read("test.err")).to include "invalid subcommittee type"
|
1451
|
-
end
|
1396
|
+
end
|
1452
1397
|
|
1453
|
-
it "Warning if invalid subcommittee type" do
|
1454
|
-
|
1455
|
-
|
1456
|
-
|
1457
|
-
|
1458
|
-
|
1459
|
-
|
1460
|
-
|
1461
|
-
|
1462
|
-
|
1463
|
-
INPUT
|
1398
|
+
it "Warning if invalid subcommittee type" do
|
1399
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1400
|
+
= Document title
|
1401
|
+
Author
|
1402
|
+
:docfile: test.adoc
|
1403
|
+
:nodoc:
|
1404
|
+
:subcommittee-type: X
|
1405
|
+
:no-isobib:
|
1406
|
+
|
1407
|
+
INPUT
|
1464
1408
|
expect(File.read("test.err")).to include "invalid subcommittee type"
|
1465
|
-
end
|
1409
|
+
end
|
1466
1410
|
|
1467
|
-
it "Warning if 'see' crossreference points to normative section" do
|
1468
|
-
|
1469
|
-
|
1470
|
-
|
1471
|
-
|
1472
|
-
== Terms and Definitions
|
1411
|
+
it "Warning if 'see' crossreference points to normative section" do
|
1412
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1413
|
+
#{VALIDATING_BLANK_HDR}
|
1414
|
+
[[terms]]
|
1415
|
+
== Terms and Definitions
|
1473
1416
|
|
1474
|
-
|
1475
|
-
|
1476
|
-
|
1417
|
+
== Clause
|
1418
|
+
See <<terms>>
|
1419
|
+
INPUT
|
1477
1420
|
expect(File.read("test.err")).to include "'see terms' is pointing to a normative section"
|
1478
|
-
end
|
1421
|
+
end
|
1479
1422
|
|
1480
|
-
it "Warning if 'see' reference points to normative reference" do
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
INPUT
|
1423
|
+
it "Warning if 'see' reference points to normative reference" do
|
1424
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1425
|
+
#{VALIDATING_BLANK_HDR}
|
1426
|
+
[bibliography]
|
1427
|
+
== Normative References
|
1428
|
+
* [[[terms,ISO 1]]] _References_
|
1429
|
+
|
1430
|
+
== Clause
|
1431
|
+
See <<terms>>
|
1432
|
+
INPUT
|
1491
1433
|
expect(File.read("test.err")).to include "is pointing to a normative reference"
|
1492
|
-
end
|
1434
|
+
end
|
1493
1435
|
|
1494
|
-
it "Warning if term definition starts with article" do
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
== Terms and Definitions
|
1436
|
+
it "Warning if term definition starts with article" do
|
1437
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1438
|
+
#{VALIDATING_BLANK_HDR}
|
1439
|
+
== Terms and Definitions
|
1499
1440
|
|
1500
|
-
|
1441
|
+
=== Term
|
1501
1442
|
|
1502
|
-
|
1503
|
-
|
1443
|
+
The definition of a term is a part of the specialized vocabulary of a particular field
|
1444
|
+
INPUT
|
1504
1445
|
expect(File.read("test.err")).to include "term definition starts with article"
|
1505
|
-
end
|
1446
|
+
end
|
1506
1447
|
|
1507
|
-
it "Warning if term definition ends with period" do
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
== Terms and Definitions
|
1448
|
+
it "Warning if term definition ends with period" do
|
1449
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1450
|
+
#{VALIDATING_BLANK_HDR}
|
1451
|
+
== Terms and Definitions
|
1512
1452
|
|
1513
|
-
|
1453
|
+
=== Term
|
1514
1454
|
|
1515
|
-
|
1516
|
-
|
1455
|
+
Part of the specialized vocabulary of a particular field.
|
1456
|
+
INPUT
|
1517
1457
|
expect(File.read("test.err")).to include "term definition ends with period"
|
1518
|
-
end
|
1458
|
+
end
|
1519
1459
|
|
1520
|
-
it "validates document against ISO XML schema" do
|
1521
|
-
|
1522
|
-
|
1523
|
-
#{VALIDATING_BLANK_HDR}
|
1460
|
+
it "validates document against ISO XML schema" do
|
1461
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1462
|
+
#{VALIDATING_BLANK_HDR}
|
1524
1463
|
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1464
|
+
[align=mid-air]
|
1465
|
+
Para
|
1466
|
+
INPUT
|
1528
1467
|
expect(File.read("test.err")).to include 'value of attribute "align" is invalid; must be equal to'
|
1529
|
-
end
|
1468
|
+
end
|
1530
1469
|
|
1531
|
-
it "Warn if more than 7 levels of subclause" do
|
1532
|
-
|
1533
|
-
|
1534
|
-
|
1535
|
-
|
1536
|
-
|
1537
|
-
|
1538
|
-
|
1539
|
-
:language: fr
|
1470
|
+
it "Warn if more than 7 levels of subclause" do
|
1471
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1472
|
+
= Document title
|
1473
|
+
Author
|
1474
|
+
:docfile: test.adoc
|
1475
|
+
:nodoc:
|
1476
|
+
:no-isobib:
|
1477
|
+
:language: fr
|
1540
1478
|
|
1541
|
-
|
1479
|
+
== Clause
|
1542
1480
|
|
1543
|
-
|
1481
|
+
=== Clause
|
1544
1482
|
|
1545
|
-
|
1483
|
+
==== Clause
|
1546
1484
|
|
1547
|
-
|
1485
|
+
===== Clause
|
1548
1486
|
|
1549
|
-
|
1487
|
+
====== Clause
|
1550
1488
|
|
1551
|
-
|
1552
|
-
|
1489
|
+
[level=6]
|
1490
|
+
====== Clause
|
1553
1491
|
|
1554
|
-
|
1555
|
-
|
1492
|
+
[level=7]
|
1493
|
+
====== Clause
|
1556
1494
|
|
1557
|
-
|
1558
|
-
|
1495
|
+
[level=8]
|
1496
|
+
====== Clause
|
1559
1497
|
|
1560
|
-
|
1498
|
+
INPUT
|
1561
1499
|
expect(File.read("test.err")).to include "Exceeds the maximum clause depth of 7"
|
1562
|
-
end
|
1500
|
+
end
|
1563
1501
|
|
1564
|
-
it "Do not warn if not more than 7 levels of subclause" do
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
:language: fr
|
1502
|
+
it "Do not warn if not more than 7 levels of subclause" do
|
1503
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1504
|
+
= Document title
|
1505
|
+
Author
|
1506
|
+
:docfile: test.adoc
|
1507
|
+
:nodoc:
|
1508
|
+
:no-isobib:
|
1509
|
+
:language: fr
|
1573
1510
|
|
1574
|
-
|
1511
|
+
== Clause
|
1575
1512
|
|
1576
|
-
|
1513
|
+
=== Clause
|
1577
1514
|
|
1578
|
-
|
1515
|
+
==== Clause
|
1579
1516
|
|
1580
|
-
|
1517
|
+
===== Clause
|
1581
1518
|
|
1582
|
-
|
1519
|
+
====== Clause
|
1583
1520
|
|
1584
|
-
|
1585
|
-
|
1521
|
+
[level=6]
|
1522
|
+
====== Clause
|
1586
1523
|
|
1587
|
-
|
1588
|
-
|
1524
|
+
[level=7]
|
1525
|
+
====== Clause
|
1589
1526
|
|
1590
|
-
|
1527
|
+
INPUT
|
1591
1528
|
expect(File.read("test.err")).not_to include "exceeds the maximum clause depth of 7"
|
1592
|
-
end
|
1529
|
+
end
|
1593
1530
|
|
1594
|
-
it "Warn if term citation in Terms & Definitions not preceded with italicised term" do
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
== Terms and Definitions
|
1531
|
+
it "Warn if term citation in Terms & Definitions not preceded with italicised term" do
|
1532
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1533
|
+
#{VALIDATING_BLANK_HDR}
|
1534
|
+
== Terms and Definitions
|
1599
1535
|
|
1600
|
-
|
1601
|
-
|
1536
|
+
[[term]]
|
1537
|
+
=== Term
|
1602
1538
|
|
1603
|
-
|
1604
|
-
|
1539
|
+
The definition of a term (<<term>>) is a part of the specialized vocabulary of a particular field
|
1540
|
+
INPUT
|
1605
1541
|
expect(File.read("test.err")).to include "term citation not preceded with italicised term"
|
1606
|
-
end
|
1607
|
-
|
1608
|
-
it "Warn if an undated reference has no associated footnote" do
|
1609
|
-
FileUtils.rm_f "test.err"
|
1610
|
-
Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)
|
1611
|
-
#{VALIDATING_BLANK_HDR}
|
1612
|
-
|
1613
|
-
[bibliography]
|
1614
|
-
== Bibliography
|
1615
|
-
* [[[ISO8,ISO 8:--]]], _Title_
|
1616
|
-
INPUT
|
1617
|
-
expect(File.read("test.err")).to include "Reference ISO8 does not have an associated footnote indicating unpublished status"
|
1618
|
-
end
|
1542
|
+
end
|
1619
1543
|
|
1544
|
+
it "Warn if an undated reference has no associated footnote" do
|
1545
|
+
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
1546
|
+
#{VALIDATING_BLANK_HDR}
|
1620
1547
|
|
1548
|
+
[bibliography]
|
1549
|
+
== Bibliography
|
1550
|
+
* [[[ISO8,ISO 8:--]]], _Title_
|
1551
|
+
INPUT
|
1552
|
+
expect(File.read("test.err")).to include \
|
1553
|
+
"Reference ISO8 does not have an associated footnote indicating unpublished status"
|
1554
|
+
end
|
1621
1555
|
end
|