require "spec_helper"
RSpec.describe IsoDoc do
it "processes section names" do
input = <<~INPUT
Foreword
This is a preamble
Introduction
Introduction Subsection
This is patent boilerplate
Scope
Text
Terms, Definitions, Symbols and Abbreviated Terms
Normal Terms
Term2
- Symbol
- Definition
- Symbol
- Definition
Clause 4
Introduction
Clause 4.2
Annex
Annex A.1
Annex A.1a
An Appendix
Appendix subclause
Annex Bibliography
Normative References
Bibliography
Bibliography Subsection
INPUT
presxml = <<~OUTPUT
Foreword
This is a preamble
0Introduction
0.1Introduction Subsection
This is patent boilerplate
1Scope
Text
3Terms, Definitions, Symbols and Abbreviated Terms
3.1Normal Terms
3.1.1
Term2
3.2
- Symbol
- Definition
4
- Symbol
- Definition
5Clause 4
5.1Introduction
5.2Clause 4.2
Annex A
(normative)
Annex
A.1Annex A.1
A.1.1Annex A.1a
Appendix 1An Appendix
Appendix 1.1Appendix subclause
A.2Annex Bibliography
2Normative References
Bibliography
Bibliography Subsection
OUTPUT
html = <<~OUTPUT
#{HTML_HDR}
Foreword
This is a preamble
0 Introduction
0.1 Introduction Subsection
This is patent boilerplate
2 Normative References
3 Terms, Definitions, Symbols and Abbreviated Terms
3.1 Normal Terms
3.1.1
Term2
5 Clause 4
5.1 Introduction
5.2 Clause 4.2
Annex A
(normative)
Annex
A.1 Annex A.1
A.1.1 Annex A.1a
Appendix 1 An Appendix
Appendix 1.1 Appendix subclause
A.2 Annex Bibliography
Bibliography
Bibliography Subsection