-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
derive: fail if requested template block is missing
- Loading branch information
Showing
8 changed files
with
91 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% extends "no-block-with-include-times-2.txt" %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{% block also_also_not_a %}{% endblock %} | ||
{% include "no-block-with-include.txt" %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{% block also_not_a %}{% endblock %} | ||
{% include "no-block.txt" %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{% block not_a %}{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use rinja::Template; | ||
|
||
#[derive(Template)] | ||
#[template( | ||
ext = "txt", | ||
source = "{% block not_a %}{% endblock %}", | ||
block = "a" | ||
)] | ||
struct SourceTemplate; | ||
|
||
#[derive(Template)] | ||
#[template(path = "no-block.txt", block = "a")] | ||
struct PathTemplate; | ||
|
||
#[derive(Template)] | ||
#[template(path = "no-block-with-include.txt", block = "a")] | ||
struct NoBlockWithInclude; | ||
|
||
#[derive(Template)] | ||
#[template(path = "no-block-with-include-times-2.txt", block = "a")] | ||
struct NoBlockWithIncludeTimes2; | ||
|
||
#[derive(Template)] | ||
#[template(path = "no-block-with-base-template.txt", block = "a")] | ||
struct NoBlockWithBaseTemplate; | ||
|
||
fn main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
error: cannot find block `a` | ||
--> tests/ui/no-block.rs:7:13 | ||
| | ||
7 | block = "a" | ||
| ^^^ | ||
|
||
error: cannot find block `a` | ||
--> tests/ui/no-block.rs:12:43 | ||
| | ||
12 | #[template(path = "no-block.txt", block = "a")] | ||
| ^^^ | ||
|
||
error: cannot find block `a` | ||
--> tests/ui/no-block.rs:16:56 | ||
| | ||
16 | #[template(path = "no-block-with-include.txt", block = "a")] | ||
| ^^^ | ||
|
||
error: cannot find block `a` | ||
--> tests/ui/no-block.rs:20:64 | ||
| | ||
20 | #[template(path = "no-block-with-include-times-2.txt", block = "a")] | ||
| ^^^ | ||
|
||
error: cannot find block `a` | ||
--> tests/ui/no-block.rs:24:62 | ||
| | ||
24 | #[template(path = "no-block-with-base-template.txt", block = "a")] | ||
| ^^^ |