Class TokenizerTester
In: tests/tokenizertester.rb
Parent: NQXMLTester

# Add a method to the tokenizer module NQXML

    class Tokenizer
     def testOnlySetInternalEntities(h); @internalEntites = h; end
    end

end

Methods
compare_tokens_with_expected    expect_error    test_arguments    test_attr_val_lt_char    test_attr_val_lt_predefined    test_comment_with_newline_bug    test_different_newlines    test_encoding    test_entities    test_entity_replacement    test_from_tempfile    test_heredoc    test_lt    test_missing_qmark    test_name_grabbing    test_param_entities    test_predefined_entity_replacement    test_public_id_chars    test_tokens    test_twin_attrs    test_two_slashes   
Classes and Modules
Class TokenizerTester::<< t
Public Instance methods
test_predefined_entity_replacement()

Tests simple predefined entity replacement

test_entity_replacement()

Tests the entity replacement routine.

test_encoding()

Makes sure special character encoding is working

test_name_grabbing()

Make sure names are read correctly.

test_heredoc()

Make sure the tokenizer can handle here documents.

expect_error(xml, regex, line = nil, col = nil, pos = nil)

Creates a tokenizer over the xml and sets it to tokenizing. Expect a parser error that matches regex. If line, col, or pos is not nil, expect the error to occur in the specified position(s).

test_missing_qmark()

Make sure we detect missing '?' at the end of processing instructions.

test_two_slashes()

Disallow two slashes in one tag.

test_twin_attrs()

Well-formedness check: the same attribute name may not appear twice in the same tag.

test_arguments()

Make sure the tokenizer rejects or accepts the proper inputs.

test_public_id_chars()

Make sure tokenizer rejects illegal public identifier

test_entities()

Make sure entities are tokenized correctly.

test_param_entities()

Make sure entities are tokenized correctly. The example XML is taken almost verbatim from the XML specification.

test_from_tempfile()

Passes a Tempfile to a Tokenizer. Fails if any parser error is raised.

compare_tokens_with_expected(xml)
test_tokens()

Tokenizes @rsrc.xml and compares the entities returned with a list of expected values.

test_different_newlines()
test_lt()

This XML fragment made the tokenizer barf because the &lt; was being translated and then seen as a tag open character.

test_attr_val_lt_predefined()
test_attr_val_lt_char()
test_comment_with_newline_bug()