Skip to content

Commit

Permalink
Update the failure test.
Browse files Browse the repository at this point in the history
Still commented, due to how instable it is.
  • Loading branch information
Drup committed Apr 22, 2021
1 parent 219e820 commit 523c5e6
Show file tree
Hide file tree
Showing 3 changed files with 222 additions and 21 deletions.
6 changes: 3 additions & 3 deletions test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
235 changes: 217 additions & 18 deletions test/html_fail.expected
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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

2 changes: 2 additions & 0 deletions test/html_fail.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ open Tyxml.Html ;;
div [a [a []]] ;;

div [address [a [address []]]];;

body [dl [dd [txt "foo"]; dt [a [h1 [txt "foo"]]]]];;

0 comments on commit 523c5e6

Please sign in to comment.