Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,26 @@ const snapshot_files: []const []const u8 = &.{
};

const conformance_accept_files: []const []const u8 = &.{
"test/conformance/accept/header_and_title_order.hdoc",
"test/conformance/accept/image_with_required_path.hdoc",
"test/conformance/accept/inline_escape.hdoc",
"test/conformance/accept/no_title_document.hdoc",
"test/conformance/accept/title_header_redundant.hdoc",
};

const conformance_reject_files: []const []const u8 = &.{
"test/conformance/reject/string_cr_escape.hdoc",
"test/conformance/reject/inline_identifier_dash.hdoc",
"test/conformance/reject/container_children.hdoc",
"test/conformance/reject/duplicate_header.hdoc",
"test/conformance/reject/hdoc_body_non_empty.hdoc",
"test/conformance/reject/heading_sequence.hdoc",
"test/conformance/reject/image_missing_path.hdoc",
"test/conformance/reject/inline_identifier_dash.hdoc",
"test/conformance/reject/missing_header.hdoc",
"test/conformance/reject/nested_top_level.hdoc",
"test/conformance/reject/container_children.hdoc",
"test/conformance/reject/time_relative_fmt.hdoc",
"test/conformance/reject/ref_in_heading.hdoc",
"test/conformance/reject/string_cr_escape.hdoc",
"test/conformance/reject/title_after_content.hdoc",
};

pub fn build(b: *std.Build) void {
Expand Down
5 changes: 5 additions & 0 deletions test/conformance/accept/header_and_title_order.hdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hdoc(version="2.0", lang="en");

title { Proper Order }

p "Body content"
24 changes: 24 additions & 0 deletions test/conformance/accept/header_and_title_order.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
document:
version:
major: 2
minor: 0
lang: "en"
title:
simple: "Proper Order"
full:
lang: ""
content:
- [] "Proper Order"
author: null
date: null
toc:
level: h1
headings: []
children: []
contents:
- paragraph:
lang: ""
content:
- [] "Body content"
ids:
- null
3 changes: 3 additions & 0 deletions test/conformance/accept/image_with_required_path.hdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hdoc(version="2.0", lang="en");

img(path="media/picture.png", alt="Example figure") { Figure caption }
21 changes: 21 additions & 0 deletions test/conformance/accept/image_with_required_path.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
document:
version:
major: 2
minor: 0
lang: "en"
title: null
author: null
date: null
toc:
level: h1
headings: []
children: []
contents:
- image:
lang: ""
alt: "Example figure"
path: "media/picture.png"
content:
- [] "Figure caption"
ids:
- null
3 changes: 3 additions & 0 deletions test/conformance/accept/no_title_document.hdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hdoc(version="2.0", lang="en");

p "Untitled body"
19 changes: 19 additions & 0 deletions test/conformance/accept/no_title_document.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
document:
version:
major: 2
minor: 0
lang: "en"
title: null
author: null
date: null
toc:
level: h1
headings: []
children: []
contents:
- paragraph:
lang: ""
content:
- [] "Untitled body"
ids:
- null
20 changes: 20 additions & 0 deletions test/conformance/reject/duplicate_header.diag
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[
{
"code": {
"misplaced_hdoc_header": {}
},
"location": {
"line": 3,
"column": 1
}
},
{
"code": {
"duplicate_hdoc_header": {}
},
"location": {
"line": 3,
"column": 1
}
}
]
5 changes: 5 additions & 0 deletions test/conformance/reject/duplicate_header.hdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hdoc(version="2.0", lang="en");

hdoc(version="2.0", lang="en");

p "Duplicate headers"
11 changes: 11 additions & 0 deletions test/conformance/reject/hdoc_body_non_empty.diag
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"code": {
"non_empty_hdoc_body": {}
},
"location": {
"line": 1,
"column": 1
}
}
]
1 change: 1 addition & 0 deletions test/conformance/reject/hdoc_body_non_empty.hdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hdoc(version="2.0", lang="en") "not empty"
14 changes: 14 additions & 0 deletions test/conformance/reject/image_missing_path.diag
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"code": {
"missing_attribute": {
"type": "img",
"name": "path"
}
},
"location": {
"line": 3,
"column": 1
}
}
]
3 changes: 3 additions & 0 deletions test/conformance/reject/image_missing_path.hdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hdoc(version="2.0", lang="en");

img { Figure caption }
11 changes: 11 additions & 0 deletions test/conformance/reject/missing_header.diag
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"code": {
"missing_hdoc_header": {}
},
"location": {
"line": 1,
"column": 1
}
}
]
1 change: 1 addition & 0 deletions test/conformance/reject/missing_header.hdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
p "No header present"
11 changes: 11 additions & 0 deletions test/conformance/reject/title_after_content.diag
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[
{
"code": {
"misplaced_title_block": {}
},
"location": {
"line": 5,
"column": 1
}
}
]
5 changes: 5 additions & 0 deletions test/conformance/reject/title_after_content.hdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hdoc(version="2.0", lang="en");

p "First content"

title { Late Title }