diff --git a/test/dune b/test/dune index 657f0421f..8068242aa 100644 --- a/test/dune +++ b/test/dune @@ -43,11 +43,11 @@ ; (rule ; (targets html_fail.result) ; (deps ppx.exe html_fail.ml) -; (action (system "TERM= %{ocaml} -I ../implem/.tyxml.objs/ -noinit -noprompt -ppx './%{exe:ppx.exe} --as-ppx' < html_fail.ml 2>&1 | tail -n +3 > %{targets}")) +; (action (system "TERM= %{ocaml} -I ../implem/.tyxml.objs/byte/ -noinit -noprompt -ppx './%{exe:ppx.exe} --as-ppx' < html_fail.ml 2>&1 | tail -n +3 > %{targets}")) ; ) -; (alias -; (name runtest) +; (rule +; (alias runtest) ; (deps html_fail.result html_fail.expected) ; (action (diff html_fail.expected html_fail.result)) ; (package tyxml-ppx) diff --git a/test/html_fail.expected b/test/html_fail.expected index 1aa855dca..a3a82ed9f 100644 --- a/test/html_fail.expected +++ b/test/html_fail.expected @@ -1,31 +1,33 @@ -Characters 6-14: - div [a [a []]] ;; - ^^^^^^^^ -Error: This expression has type - ([> 'b Html_types.a ] as 'a) Tyxml.Html.elt = 'a Tyxml_html.elt +Line 2, characters 5-13: +2 | div [a [a []]] ;; + ^^^^^^^^ +Error: This expression has type + ([> ([> 'c Html_types.a ] as 'b) Html_types.a ] as 'a) + Tyxml.Html.elt = 'a Tyxml_html.elt but an expression was expected of type ([< Html_types.div_content_fun ] as 'd) Tyxml.Html.elt = 'd Tyxml_html.elt Type 'a = [> `A of 'b ] is not compatible with type 'd = - [< `A of Html_types.flow5_without_interactive + [< `A of Html_types.flow5_without_interactive_header_footer | `Abbr | `Address | `Article | `Aside - | `Audio of Html_types.flow5_without_media - | `Audio_interactive of Html_types.flow5_without_media + | `Audio of Html_types.flow5_without_media_header_footer + | `Audio_interactive of + Html_types.flow5_without_media_header_footer | `B | `Bdo | `Blockquote | `Br | `Button - | `Canvas of Html_types.flow5 + | `Canvas of Html_types.flow5_without_header_footer | `Cite | `Code | `Command | `Datalist - | `Del of Html_types.flow5 + | `Del of Html_types.flow5_without_header_footer | `Details | `Dfn | `Div @@ -50,23 +52,24 @@ Error: This expression has type | `Img | `Img_interactive | `Input - | `Ins of Html_types.flow5 + | `Ins of Html_types.flow5_without_header_footer | `Kbd | `Keygen | `Label | `Main - | `Map of Html_types.flow5 + | `Map of Html_types.flow5_without_header_footer | `Mark | `Menu | `Meter | `Nav - | `Noscript of Html_types.flow5_without_noscript - | `Object of Html_types.flow5 - | `Object_interactive of Html_types.flow5 + | `Noscript of Html_types.flow5_without_noscript_header_footer + | `Object of Html_types.flow5_without_header_footer + | `Object_interactive of Html_types.flow5_without_header_footer | `Ol | `Output | `P | `PCDATA + | `Picture | `Pre | `Progress | `Q @@ -83,15 +86,211 @@ Error: This expression has type | `Sup | `Svg | `Table + | `Template | `Textarea | `Time | `U | `Ul | `Var - | `Video of Html_types.flow5_without_media - | `Video_interactive of Html_types.flow5_without_media + | `Video of Html_types.flow5_without_media_header_footer + | `Video_interactive of + Html_types.flow5_without_media_header_footer | `Wbr ] Type 'b = [> `A of 'c ] is not compatible with type - Html_types.flow5_without_interactive + Html_types.flow5_without_interactive_header_footer + Types for tag `A are incompatible +Line 2, characters 14-28: +2 | div [address [a [address []]]];; + ^^^^^^^^^^^^^^ +Error: This expression has type + ([> ([> Html_types.address ] as 'b) Html_types.a ] as 'a) + Tyxml.Html.elt = 'a Tyxml_html.elt + but an expression was expected of type + ([< Html_types.address_content_fun ] as 'c) Tyxml.Html.elt = + 'c Tyxml_html.elt + Type 'a = [> `A of 'b ] is not compatible with type + 'c = + [< `A of + Html_types.flow5_without_interactive_sectioning_heading_header_footer_address + | `Abbr + | `Audio of + Html_types.flow5_without_media_sectioning_heading_header_footer_address + | `Audio_interactive of + Html_types.flow5_without_media_sectioning_heading_header_footer_address + | `B + | `Bdo + | `Blockquote + | `Br + | `Button + | `Canvas of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Cite + | `Code + | `Command + | `Datalist + | `Del of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Details + | `Dfn + | `Div + | `Dl + | `Em + | `Embed + | `Fieldset + | `Figure + | `Form + | `Hr + | `I + | `Iframe + | `Img + | `Img_interactive + | `Input + | `Ins of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Kbd + | `Keygen + | `Label + | `Main + | `Map of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Mark + | `Menu + | `Meter + | `Noscript of + Html_types.flow5_without_noscript_sectioning_heading_header_footer_address + | `Object of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Object_interactive of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Ol + | `Output + | `P + | `PCDATA + | `Picture + | `Pre + | `Progress + | `Q + | `Ruby + | `Samp + | `Script + | `Select + | `Small + | `Span + | `Strong + | `Style + | `Sub + | `Sup + | `Svg + | `Table + | `Template + | `Textarea + | `Time + | `U + | `Ul + | `Var + | `Video of + Html_types.flow5_without_media_sectioning_heading_header_footer_address + | `Video_interactive of + Html_types.flow5_without_media_sectioning_heading_header_footer_address + | `Wbr ] + Type 'b = [> `Address ] is not compatible with type + Html_types.flow5_without_interactive_sectioning_heading_header_footer_address + Types for tag `A are incompatible +Line 2, characters 30-48: +2 | body [dl [dd [txt "foo"]; dt [a [h1 [txt "foo"]]]]];; + ^^^^^^^^^^^^^^^^^^ +Error: This expression has type + ([> ([> Html_types.h1 ] as 'b) Html_types.a ] as 'a) Tyxml.Html.elt + = 'a Tyxml_html.elt + but an expression was expected of type + ([< Html_types.dt_content_fun ] as 'c) Tyxml.Html.elt = + 'c Tyxml_html.elt + Type 'a = [> `A of 'b ] is not compatible with type + 'c = + [< `A of + Html_types.flow5_without_interactive_sectioning_heading_header_footer_address + | `Abbr + | `Audio of + Html_types.flow5_without_media_sectioning_heading_header_footer_address + | `Audio_interactive of + Html_types.flow5_without_media_sectioning_heading_header_footer_address + | `B + | `Bdo + | `Blockquote + | `Br + | `Button + | `Canvas of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Cite + | `Code + | `Command + | `Datalist + | `Del of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Details + | `Dfn + | `Div + | `Dl + | `Em + | `Embed + | `Fieldset + | `Figure + | `Form + | `Hr + | `I + | `Iframe + | `Img + | `Img_interactive + | `Input + | `Ins of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Kbd + | `Keygen + | `Label + | `Main + | `Map of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Mark + | `Menu + | `Meter + | `Noscript of + Html_types.flow5_without_noscript_sectioning_heading_header_footer_address + | `Object of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Object_interactive of + Html_types.flow5_without_sectioning_heading_header_footer_address + | `Ol + | `Output + | `P + | `PCDATA + | `Picture + | `Pre + | `Progress + | `Q + | `Ruby + | `Samp + | `Script + | `Select + | `Small + | `Span + | `Strong + | `Style + | `Sub + | `Sup + | `Svg + | `Table + | `Template + | `Textarea + | `Time + | `U + | `Ul + | `Var + | `Video of + Html_types.flow5_without_media_sectioning_heading_header_footer_address + | `Video_interactive of + Html_types.flow5_without_media_sectioning_heading_header_footer_address + | `Wbr ] + Type 'b = [> `H1 ] is not compatible with type + Html_types.flow5_without_interactive_sectioning_heading_header_footer_address Types for tag `A are incompatible diff --git a/test/html_fail.ml b/test/html_fail.ml index 1a85fe85f..3382af029 100644 --- a/test/html_fail.ml +++ b/test/html_fail.ml @@ -3,3 +3,5 @@ open Tyxml.Html ;; div [a [a []]] ;; div [address [a [address []]]];; + +body [dl [dd [txt "foo"]; dt [a [h1 [txt "foo"]]]]];;