summaryrefslogtreecommitdiff
path: root/test/reader_test.rb
AgeCommit message (Collapse)Author
2019-03-20log info level message if optional include is droppedDan Allen
- log info level message if optional include is dropped for any reason - wrap info log message in Ruby block
2019-03-20resolves #2855 honor attribute-missing setting when processing include directiveDan Allen
2019-03-20resolves #2868 log warning when include directive is not resolved due to ↵Dan Allen
missing attribute (PR #3171)
2019-03-19resolves #3161 log warning if conditional expression in ifeval directive is ↵Dan Allen
invalid (PR #3168) - log warning if conditional expression in ifeval directive is invalid (#3161) - drop lines that contain an invalid preprocessor directive (#3161)
2019-03-19resolves #3164 fix crash if ifeval directive is missing expression (PR #3167)Dan Allen
2019-03-19resolves #3165 use proper terminology in warning message about mismatched ↵Dan Allen
preprocessor directive (PR #3166) - use proper terminology in warning message for preprocessor directive - add tests for unmatched and mismatched preprocessor directive
2019-03-14resolves #1444 rename header_footer option to standalone (PR #3146)Dan Allen
* still honor header_footer option as fallback for backwards compatibility
2019-02-16enforce and report relative max include depth properly (PR #3075)Dan Allen
- enforce and report relative max include depth properly - depth=0 on include directive disables nested includes (instead of depth=1) - rename PreprocessorReader#exceeded_max_depth? to PreprocessorReader#exceeds_max_depth? - change PreprocessorReader#exceeds_max_depth? to return nil if includes are disabled - add api doc to PreprocessorReader#exceeds_max_depth?
2019-02-15clean up newline handling in test suite (PR #3074)Dan Allen
- use chop instead of chomp to remove trailing newline from heredoc string - document all uses of non-quoted squiggly heredoc to preserve indentation - fix incorrect preparation of uniform indentation in list tests - remove unnecessary uses of chomp
2019-02-11implement more detailed Reader#to_s method (to match PreprocessorReader)Dan Allen
2019-02-10use indented (squiggly) heredoc strings in reader_testDan Allen
2019-02-10resolves #3054 never mutate strings; add `frozen_string_literal: true` ↵Dan Allen
comment to source files (PR #3055) - replace gsub! and sub! with gsub and sub, respectively - add `frozen_string_literal: true` magic comment to all Ruby source files - see https://www.mikeperham.com/2018/02/28/ruby-optimization-with-one-magic-comment/
2019-02-04use do..end syntax for multiline blocks in test suiteDan Allen
2019-01-26use the term newline(s) instead of endline(s) [skip ci]Dan Allen
2019-01-06use .adoc as AsciiDoc file extension in test suiteDan Allen
2019-01-06Reader#push_include should not fail if data is nilDan Allen
2019-01-06add visibility modifiers to methodsDan Allen
- mark private and protected methods (either individually or by section) - reorder methods by visibility where appropriate - move nextval helper method to Helpers - move class_for_name and resolve_class methods to Helpers - mark methods on Logger module (logger and message_with_context) as public - add some API doc where needed; fix visibility labels
2019-01-06switch to modern hash syntaxDan Allen
- switch to modern hash syntax (from :key => value to key: value) - put space inside hash brackets (from {key: value} to { key: value } - use dangling comma on last entry of multi-line hash
2019-01-06read input File as string; rename Helpers.normalize_lines* methodsDan Allen
- read input into string instead of array - rename Helpers.normalize_lines* methods to Helpers.prepare_source* - update API docs - add alias constant for UTF_8 encoding - remove unused Helpers.prepare_source method - remove workaround for encoding array to UTF-16LE
2019-01-06modernize UTF-8 encoding operationsDan Allen
- encode strings to UTF-8 properly instead of force encoding - remove FORCE_ENCODING constant - use File.open to read include files - use OpenURI.open_uri to read URIs (instead of Kernel.open) - define constants for file and URI read and write modes (FILE_READ_MODE, URI_READ_MODE, and FILE_WRITE_MODE) - read files and URIs using the rb:utf-8 mode (except on Opal, drop the binary and encoding flags) - write files using the w:utf-8 mode (except on Opal, drop the encoding flag) - use byteslice instead of slice to remove BOM from string - remove valid_encoding? workaround for JRuby 1.7
2019-01-06use require_relative instead of modifying $LOAD_PATHDan Allen
- use require_relative in place of require when it relied on $LOAD_PATH manipulation - configure bin scripts to work with require_relative - rename ROOT_PATH to ROOT_DIR - rename DATA_PATH to DATA_DIR - rename STYLESHEETS_DATA_PATH to STYLESHEETS_DIR - define LIB_DIR - simplify test helper require and setup - add bindir helper to test suite - remove unneeded constants in test helper - reorder autoload statements - require version directly instead of autoloading
2019-01-06remove workarounds for Ruby < 2.3Dan Allen
- remove constants for differentiating between Ruby versions - remove fallback assignment for RUBY_ENGINE constant - remove rubygems require - use unicode character properties in regular expressions (e.g., \p{Word}) - remove COERCE_ENCODING constant - always set FORCE_ENCODING constant to true unless default external encoding is not UTF-8 - remove workaround for computing line length - use lines method instead of lines.entries to get lines for string - always normalize lines - check if JRuby class is defined instead of checking for JRuby engine - remove global RUBY_ENGINE_JRUBY constant - move RUBY_ENGINE_OPAL constant inside Asciidoctor module - remove magic encoding comments (since default script encoding is UTF-8) - remove workaround when printing encoding information - remove fallback assignments for passthrough escape characters - remove Ruby core backports (only leave Asciidoctor-specific extensions) - use __dir__ instead of File.dirname __FILE__ - use Float#truncate to truncate column widths - override Float#truncate on Ruby 2.3 to implement precision argument - remove concurrent/hash backport - simplify class_for_name helper - don't call to_sym on constants returned from constants method - remove unnecessary aliasing of regexp match variables; use magic variable instead (e.g., m = $~) - remove workaround for sub_specialchars to accomodate gsub with map argument - remove comment about %:z placeholder for strftime - don't call .to_a on return value of Hash#keys - get home directory using Dir.home - remove exceptions and exclusions for Ruby < 2 in test suite - update list of supported Ruby engines and versions in READMEs - update ruby versions in run-tests.sh
2018-10-14resolves #2914 interpret open line range as infinite (PR #2917)Dan Allen
2018-09-11replace the use of render with convert in test suiteDan Allen
- rename render_string to convert_string - rename render_embedded_string to convert_string_to_embedded - rename render_inline_string to convert_inline_string - use convert_inline_string where :doctype was being set to :inline
2018-08-04resolves #2830 detect closing tag on last line with no trailing newline (PR ↵Dan Allen
#2831)
2018-05-08resolves #2761 substitute attribute references in attrlist of include directiveDan Allen
2018-04-28add cursor for include file to message context about include tagsDan Allen
2018-04-28use cursor from source file as context for messages about include tagsDan Allen
2018-04-28match tag directives in include files that have CRLF line endings (see #2369)Dan Allen
2018-04-23rename cursor methods on ReaderDan Allen
- rename cursor_at to cursor_at_line - rename prev_line_cursor to cursor_at_prev_line
2018-04-23use cursor marks to track line numbers more accurately and efficientlyDan Allen
- add Reader#mark method to mark position of cursor (store internally) - add Reader#cursor_at_mark method to build Cursor from previously saved mark - mark position of cursor after reading block attribute lines in Parser.next_block - use Reader#cursor_at_mark to retrieve/record source location in Parser.next_block - add cursor option to Reader#read_lines_until so unterminated block warning reports start location of block - allow value of cursor option passed to Reader#read_lines_until to be :at_mark to read cursor from mark - update test assertions
2018-04-21resolves #2361 warn if a specified include tag is unclosed (PR #2696)Dan Allen
- warn if a tag specified in the include directive is unclosed in the include file - add tests to verify warnings - fix unclosed tags in test fixtures - remove duplicate test
2018-04-21fix assertion in include tag testDan Allen
2018-04-21test that warning message is reported when tag is missing in include fileDan Allen
2018-04-21rephrase some of the reader testsDan Allen
2018-04-20resolves #2369 change strategy for finding tags inside circumfix comments ↵Dan Allen
(PR #2683) - allow any content after a tag directive if offset by a space - add test to verify tag is found inside HTML inside a string in a source file
2018-04-19resolves #2200 don't convert inter-document xref to internal anchor if ↵Dan Allen
target included partially (PR #2686) - change the includes key in the document catalog from a Set to a Hash - don't track file included into the current file if included partially (partial-option attribute is set) - don't track file included into the current file unless it's AsciiDoc
2018-04-16move unterminated block warning into Reader#read_lines_untilDan Allen
2018-04-15change Reader#skip_comment_lines to not return skipped linesDan Allen
2018-04-15resolves #1133 show error if delimited block is not terminatedDan Allen
2018-04-14use helpers to assert log messages in testsDan Allen
- add assert_message helper for asserting a single message - add assert_messages helper for asserting multiple messages - rewrite paths and reader tests to assert log messages instead of stderr stream - assert message about illegal reference to parent is only reported on first violation when resolving system path - use instance variable to store shared logger in tests
2018-04-14remove unused methods in ReaderDan Allen
- drop prev_line_info in favor of prev_line_cursor.to_s - drop next_line_info (leave line_info) - use cursor instead of line info in error messages
2018-04-10use more efficient method for getting dir from URIDan Allen
2018-04-10fix failure in Preprocessor#push_include when file is a URI and path isn't setDan Allen
2018-04-09delegate to test helper method to resolve test directory and fixture pathsDan Allen
2018-04-08purge render method from test suite (except to verify alias)Dan Allen
- replace use of render method with convert method
2018-04-08update test that wasn't using redirect_streams to capture warningsDan Allen
2018-03-18resolves #2610 extract method to resolve include path (PR #2613)Dan Allen
2018-01-03add Ruby 2.5.0 to CI build matrix (PR #2528)Dan Allen
* add Ruby 2.5.0 to CI build matrix * fix warnings uncovered by Ruby 2.5
2018-01-02assert that unresolved include directive in remote file does not crash processorDan Allen