From 769963fd3fe9e7027915fc0ddfc2b0e881aa6952 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 20 Jun 2022 18:30:34 +0200 Subject: Add some more enabled tests --- src/construct/character_reference.rs | 2 - src/construct/heading_setext.rs | 1 - src/construct/partial_title.rs | 1 - src/content/flow.rs | 1 - src/content/string.rs | 2 - tests/html_flow.rs | 126 ++++++++++++++++------------------- 6 files changed, 58 insertions(+), 75 deletions(-) diff --git a/src/construct/character_reference.rs b/src/construct/character_reference.rs index af9c02e..c946dae 100644 --- a/src/construct/character_reference.rs +++ b/src/construct/character_reference.rs @@ -51,8 +51,6 @@ //! [decode_numeric]: crate::util::decode_character_reference::decode_numeric //! [character_reference_names]: crate::constant::CHARACTER_REFERENCE_NAMES //! [html]: https://html.spec.whatwg.org/multipage/parsing.html#character-reference-state -//! -//! use crate::constant::{ CHARACTER_REFERENCE_DECIMAL_SIZE_MAX, CHARACTER_REFERENCE_HEXADECIMAL_SIZE_MAX, diff --git a/src/construct/heading_setext.rs b/src/construct/heading_setext.rs index 579fa71..a418041 100644 --- a/src/construct/heading_setext.rs +++ b/src/construct/heading_setext.rs @@ -126,7 +126,6 @@ fn text_inside(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { /// ``` fn text_continue(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { // Needed to connect the text. - // To do: does it work? tokenizer.enter(TokenType::HeadingSetextText); tokenizer.events.pop(); tokenizer.events.pop(); diff --git a/src/construct/partial_title.rs b/src/construct/partial_title.rs index 322a3e6..22c3209 100644 --- a/src/construct/partial_title.rs +++ b/src/construct/partial_title.rs @@ -173,7 +173,6 @@ fn title(tokenizer: &mut Tokenizer, code: Code, kind: Kind) -> StateFnResult { tokenizer.exit(TokenType::ChunkString); at_break(tokenizer, code, kind, true) } - // To do: limit blank lines. Code::CarriageReturnLineFeed | Code::Char('\r' | '\n') => { tokenizer.consume(code); tokenizer.exit(TokenType::ChunkString); diff --git a/src/content/flow.rs b/src/content/flow.rs index f4af4ea..481c8ff 100644 --- a/src/content/flow.rs +++ b/src/content/flow.rs @@ -94,7 +94,6 @@ fn blank_line_after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { fn initial_before(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { match code { Code::None => (State::Ok, None), - // To do: should all flow just start before the prefix? _ => tokenizer.attempt_7( code_indented, code_fenced, diff --git a/src/content/string.rs b/src/content/string.rs index efb6e60..c3e825e 100644 --- a/src/content/string.rs +++ b/src/content/string.rs @@ -17,8 +17,6 @@ use crate::construct::{ }; use crate::tokenizer::{Code, State, StateFnResult, TokenType, Tokenizer}; -// To do: line endings? - /// Before string. /// /// ```markdown diff --git a/tests/html_flow.rs b/tests/html_flow.rs index 140e11d..53105a6 100644 --- a/tests/html_flow.rs +++ b/tests/html_flow.rs @@ -194,7 +194,7 @@ fn html_flow_2_comment() { "should support comments (type 2)" ); - // To do: phrasing. + // To do: attention. // assert_eq!( // micromark_with_options("*bar*\n*baz*", DANGER), // "*bar*\n

baz

", @@ -454,7 +454,7 @@ fn html_flow_5_cdata() { #[test] fn html_flow_6_basic() { - // To do: phrasing, paragraphs, etc. + // To do: attention. // assert_eq!( // micromark_with_options( // "
\n
\n**Hello**,\n\n_world_.\n
\n
", @@ -464,7 +464,6 @@ fn html_flow_6_basic() { // "should support html (basic)" // ); - // To do: paragraphs. assert_eq!( micromark_with_options( " @@ -501,7 +500,7 @@ okay.", "should support html starting w/ a closing tag" ); - // To do: phrasing. + // To do: attention. // assert_eq!( // micromark_with_options("
\n\n*Markdown*\n\n
", DANGER), // "
\n

Markdown

\n
", @@ -520,7 +519,7 @@ okay.", "should support html w/ line endings (2)" ); - // To do: phrasing. + // To do: attention. // assert_eq!( // micromark_with_options("
\n*foo*\n\n*bar*", DANGER), // "
\n*foo*\n

bar

", @@ -601,7 +600,7 @@ okay.", "should require a blank line to end" ); - // To do: phrasing. + // To do: attention. // assert_eq!( // micromark_with_options("
\n\n*Emphasized* text.\n\n
", DANGER), // "
\n

Emphasized text.

\n
", @@ -679,7 +678,7 @@ okay.", "should not support an eof directly after a self-closing slash" ); - // To do: phrasing. + // To do: attention. // assert_eq!( // micromark_with_options("
<div/\nasd

", @@ -769,14 +768,14 @@ fn html_flow_7_complete() { "should support closing tags" ); - // To do: phrasing. + // To do: attention. // assert_eq!( // micromark_with_options("\n\n*foo*\n\n", DANGER), // "\n

foo

\n
", // "should support interleaving" // ); - // To do: html (text). + // To do: attention. // assert_eq!( // micromark_with_options("*foo*", DANGER), // "

foo

", @@ -827,7 +826,7 @@ fn html_flow_7_complete() { "should not support an eof directly after a self-closing slash" ); - // To do: phrasing. + // To do: attention. // assert_eq!( // micromark_with_options("<x/\nasd

", @@ -846,19 +845,17 @@ fn html_flow_7_complete() { "should support a line ending after a self-closing tag" ); - // To do: html (text). - // assert_eq!( - // micromark_with_options("a", DANGER), - // "

a

", - // "should not support another character after a self-closing tag" - // ); + assert_eq!( + micromark_with_options("a", DANGER), + "

a

", + "should not support another character after a self-closing tag" + ); - // To do: html (text). - // assert_eq!( - // micromark_with_options("a", DANGER), - // "

a

", - // "should not support another character after an opening tag" - // ); + assert_eq!( + micromark_with_options("a", DANGER), + "

a

", + "should not support another character after an opening tag" + ); assert_eq!( micromark_with_options("", DANGER), @@ -866,32 +863,29 @@ fn html_flow_7_complete() { "should support boolean attributes in a complete tag" ); - // To do: html (text). - // assert_eq!( - // micromark_with_options("", DANGER), - // "

", - // "should not support a line ending before an attribute name" - // ); + assert_eq!( + micromark_with_options("", DANGER), + "

", + "should not support a line ending before an attribute name" + ); - // To do: html (text). - // assert_eq!( - // micromark_with_options("", DANGER), - // "

", - // "should not support a line ending w/ whitespace before an attribute name" - // ); + assert_eq!( + micromark_with_options("", DANGER), + "

", + "should not support a line ending w/ whitespace before an attribute name" + ); assert_eq!( - micromark_with_options("", DANGER), - "

<x

\n

y>

", - "should not support a line ending w/ whitespace and another line ending before an attribute name" - ); + micromark_with_options("", DANGER), + "

<x

\n

y>

", + "should not support a line ending w/ whitespace and another line ending before an attribute name" + ); - // To do: html (text). - // assert_eq!( - // micromark_with_options("", DANGER), - // "

", - // "should not support a line ending between attribute names" - // ); + assert_eq!( + micromark_with_options("", DANGER), + "

", + "should not support a line ending between attribute names" + ); assert_eq!( micromark_with_options("", DANGER), @@ -995,26 +989,23 @@ fn html_flow_7_complete() { "should support an empty single quoted attribute value" ); - // To do: html (text). - // assert_eq!( - // micromark_with_options("", DANGER), - // "

", - // "should not support a line ending in a double quoted attribute value" - // ); + assert_eq!( + micromark_with_options("", DANGER), + "

", + "should not support a line ending in a double quoted attribute value" + ); - // To do: html (text). - // assert_eq!( - // micromark_with_options("", DANGER), - // "

", - // "should not support a line ending in a single quoted attribute value" - // ); + assert_eq!( + micromark_with_options("", DANGER), + "

", + "should not support a line ending in a single quoted attribute value" + ); - // To do: html (text). - // assert_eq!( - // micromark_with_options("", DANGER), - // "

", - // "should not support a line ending in/after an unquoted attribute value" - // ); + assert_eq!( + micromark_with_options("", DANGER), + "

", + "should not support a line ending in/after an unquoted attribute value" + ); assert_eq!( micromark_with_options("", DANGER), @@ -1022,12 +1013,11 @@ fn html_flow_7_complete() { "should not support a double quote in/after an unquoted attribute value" ); - // To do: html (text). - // assert_eq!( - // micromark_with_options("", DANGER), - // "

<w x=y\"z>

", - // "should not support a single quote in/after an unquoted attribute value" - // ); + assert_eq!( + micromark_with_options("", DANGER), + "

<w x=y'z>

", + "should not support a single quote in/after an unquoted attribute value" + ); assert_eq!( micromark_with_options("", DANGER), -- cgit