diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2018-09-28 23:49:59 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2018-09-29 01:00:12 -0600 |
| commit | 73e321e0c4e87c86b4a4e4caddc1dacfaa44c0fc (patch) | |
| tree | d9938553da55d0a87ea34f911acabf60e938499f /test | |
| parent | 6e95520ed12617a13fb8d67db74daebaf653e3f5 (diff) | |
resolves #2890 consolidate inner whitespace in prose in manpage output
Diffstat (limited to 'test')
| -rw-r--r-- | test/manpage_test.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/manpage_test.rb b/test/manpage_test.rb index f3ce101e..87513165 100644 --- a/test/manpage_test.rb +++ b/test/manpage_test.rb @@ -160,6 +160,44 @@ BBB this line and the one above it should be visible) output = Asciidoctor.convert input, :backend => :manpage assert_equal '\&.if 1 .nx', output.lines.entries[-2].chomp end + + test 'should normalize whitespace in a paragraph' do + input = %(#{SAMPLE_MANPAGE_HEADER} + +Oh, here it goes again + I should have known, + should have known, +should have known again) + + output = Asciidoctor.convert input, :backend => :manpage + assert_includes output, %(Oh, here it goes again\nI should have known,\nshould have known,\nshould have known again) + end + + test 'should normalize whitespace in a list item' do + input = %(#{SAMPLE_MANPAGE_HEADER} + +* Oh, here it goes again + I should have known, + should have known, +should have known again) + + output = Asciidoctor.convert input, :backend => :manpage + assert_includes output, %(Oh, here it goes again\nI should have known,\nshould have known,\nshould have known again) + end + + test 'should collapse whitespace in the man manual and man source' do + input = %(#{SAMPLE_MANPAGE_HEADER} + +Describe this thing.) + + output = Asciidoctor.convert input, :backend => :manpage, :header_footer => true, :attributes => { + 'manmanual' => %(General\nCommands\nManual), + 'mansource' => %(Control\nAll\nThe\nThings\n5.0) + } + assert_includes output, 'Manual: General Commands Manual' + assert_includes output, 'Source: Control All The Things 5.0' + assert_includes output, '"Control All The Things 5.0" "General Commands Manual"' + end end context 'Backslash' do |
